manix Posted June 23, 2011 Share Posted June 23, 2011 I'm trying to retrieve an ID from a field but I'm failing to do so, says it's "Undefined index: id in C:\xampp\htdocs\load.php on line 8" there's nothing wrong with the code, anyways here it is: 3.while($row = mysql_fetch_assoc($result)) 4.{ 5.$story = substr($row['story'],0,80)." ..."; 6.$sheader = $row['header']; 7.$datetime = $row['datetime']; 8.$id = $row['id']; 9.} I'm retrieving all other values but the ID.. I suspect it's something wrong with the field parameters in the database: Field: id Type: int(11) Null: No Default: None Extra: AUTO_INCREMENT Quote Link to comment https://forums.phpfreaks.com/topic/240233-can-not-retrieve-id-from-db/ Share on other sites More sharing options...
Maq Posted June 23, 2011 Share Posted June 23, 2011 Post the actual query. Are you sure you're including 'id'? Quote Link to comment https://forums.phpfreaks.com/topic/240233-can-not-retrieve-id-from-db/#findComment-1234003 Share on other sites More sharing options...
manix Posted June 23, 2011 Author Share Posted June 23, 2011 oh right .. wow am I dumb :s thanks ... Quote Link to comment https://forums.phpfreaks.com/topic/240233-can-not-retrieve-id-from-db/#findComment-1234005 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.