php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #29217 Notice:Undefinied index :user
Submitted: 2004-07-16 21:05 UTC Modified: 2004-07-30 01:00 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:0 (0.0%)
From: all4blitz at fftemple dot it Assigned:
Status: No Feedback Package: Unknown/Other Function
PHP Version: 4.3.7 OS: Windows 2000 Professional
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: all4blitz at fftemple dot it
New email:
PHP Version: OS:

 

 [2004-07-16 21:05 UTC] all4blitz at fftemple dot it
Description:
------------
After any mysql query, php returns this string:
"Notice: Undefined index: user in d:\etc..."
"user" is the name of the mysql called field.
But the page still works perfectly.

Reproduce code:
---------------
$db=mysql_connect($host,$user,$pass);
mysql_select_db("sets", $db);
$query = "SELECT * FROM config LIMIT 0,1";
$result = mysql_query($query, $db); 
while ($sr = mysql_fetch_array($settings)){
if($row["default"]=="Y"){
$url_noslash=$row["url_noslash"];
$siteurl=$row["url"];
$librerie_att=$row["librerie"];
$admin_user=$row["user"];
$admin_password=$row["password"];
$session_file=$row["sessionfile"];
$counter_hp=$row["contatore_hp"];
$counter_op=$row["contatore_op"];
$predlang=$row["lingua"];
$defaultpage=$row["homepage"];
$predskin=$row["skin"];
}

Expected result:
----------------
variable "$admin_user" equal to mysql field "user" to use in the background

Actual result:
--------------
Notice: Undefined index: user in d:\etc... on line 11

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-07-16 21:08 UTC] all4blitz at fftemple dot it
the first part of the code is like this sorry:
$db=mysql_connect($host,$user,$pass);
mysql_select_db("sets", $db);
$query = "SELECT * FROM config LIMIT 0,1";
$settings = mysql_query($query, $db); 
while ($sr = mysql_fetch_array($settings)){
if($sr["default"]=="Y"){
 [2004-07-16 21:10 UTC] all4blitz at fftemple dot it
the first part of the code is like this sorry:
$db=mysql_connect($host,$user,$pass);
mysql_select_db("sets", $db);
$query = "SELECT * FROM config LIMIT 0,1";
$settings = mysql_query($query, $db); 
while ($sr = mysql_fetch_array($settings)){
if($sr["default"]=="Y"){
 [2004-07-16 22:17 UTC] georg@php.net
Thank you for this bug report. To properly diagnose the problem, we
need a short but complete example script to be able to reproduce
this bug ourselves. 

A proper reproducing script starts with <?php and ends with ?>,
is max. 10-20 lines long and does not require any external 
resources such as databases, etc.

If possible, make the script source available online and provide
an URL to it here. Try avoid embedding huge scripts into the report.

Please provide a small and working test script which 
includes 
a) a create table statement 
b) an insert statement for necessary values in your table 
c) the version of mysql server and client  
d) provide the name of columns in your select statement, 
instead of using SELECT * 
 [2004-07-30 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Wed Dec 01 10:03:34 2021 UTC