php_learner — 2013-06-28T13:18:15-04:00 — #1
hello frnds this is my code and dont know why this Undefined index: admin_name in C:\wamp\www\advance php\login\showadmin.php on line 15 pops up i am nt able to fix it please help me out
FROM admin_name,admin_detail ");
die('nt good fail to select'.mysql_error());
$name = $row['admin_name'];
echo $name." ".$last." ".$acctime." ".$pass." ".$phone." ".$mail." ".$gen;
cpradio — 2013-06-28T13:39:31-04:00 — #2
First off, your query looks wrong, I believe it should be
"SELECT admin_name.admin_name, admin_name.admin_lastname, admin_name.admin_creattime,
admin_detail.admin_pass, admin_detail.admin_phone, admin_detail.admin_email, admin_detail.admin_gender
FROM admin_name,admin_detail "
Then to figure out how to access it, write the following line within your while loop
You will either see that you need to reference the column names as $row['admin_name.admin_name'] or you may still be able to use $row['admin_name'] (I think the later will still be accurate).
php_learner — 2013-06-28T14:29:35-04:00 — #3
thanku frnd it helped me when i use index number at the place of $name = $row['admin_name']; than it works but if i do $name = $row['admin_name'] this again give the same error
spacephoenix — 2013-06-28T14:51:39-04:00 — #4
Something that you need to keep in mind is that the mysql_* extension is deprecated as of version 5.5 of PHP, you should really be migrating over to either the mysqli_* extension or to PDO
cpradio — 2013-06-28T14:53:12-04:00 — #5
Did you update your query and perform the var_dump as I stated? The var_dump will give you an output that tells you the key name to use.