undefined index error
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;
First off, your query looks wrong, I believe it should be
Then to figure out how to access it, write the following line within your while loop
"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 "
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).
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
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
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.
Originally Posted by php learner