php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #79703 Unable to use $row['field_name']
Submitted: 2020-06-15 23:49 UTC Modified: 2020-06-15 23:57 UTC
From: preetha at tyk dot jp Assigned:
Status: Not a bug Package: PDO PgSQL
PHP Version: 7.4.7 OS: Windows
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: preetha at tyk dot jp
New email:
PHP Version: OS:

 

 [2020-06-15 23:49 UTC] preetha at tyk dot jp
Description:
------------
<td><?=$rows2['id']?></td>

gives me the error 
Notice: Undefined index: id in C:\xampp\htdocs\test\index.php on line 225

But 
<td><?=$rows2['0']?></td> works



Expected result:
----------------
<td><?=$rows2['id']?></td> should give the actual data from the table field 'id'

Actual result:
--------------
<td><?=$rows2['id']?></td> does not work at all

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2020-06-15 23:51 UTC] preetha at tyk dot jp
I am using Postgre12 with PHP
****************************

c:\xampp\php>php -v
PHP 7.4.6 (cli) (built: May 12 2020 11:38:54) ( ZTS Visual C++ 2017 x64 )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
 [2020-06-15 23:57 UTC] kalle@php.net
-Status: Open +Status: Not a bug
 [2020-06-15 23:57 UTC] kalle@php.net
Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions.  Due to the volume
of reports we can not explain in detail here why your report is not
a bug.  The support channels will be able to provide an explanation
for you.

Thank you for your interest in PHP.

You need to define the fetch mode to populate associative result sets. Please see the documentation for PDOStatement::fetch().
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Dec 26 20:01:29 2024 UTC