bouwob Posted May 15, 2007 Share Posted May 15, 2007 I have this line while($row = mysql_fetch_row($result)) { echo "<tr><td>".@$row['year']."</td><td>".@$row['Make']." ".@$row['model']."</td><td>".@$row['number']."</td><td>".@$row['extra']."</td></tr>"; } [/php when I run the query that I am using to get the data here are a few of the results [code] CardID year Make number model extra filepath 2 1968 Topps 177 RC/J.Koosman RC 0 3 1968 Topps 177 Milton Bradley Jerry Koosman 0 but with the above line I am getting these messages Notice: Undefined index: Make in public_html/findcards/index.php on line 37 Notice: Undefined index: model in public_html/findcards/index.php on line 37 Notice: Undefined index: number in public_html/findcards/index.php on line 37 Notice: Undefined index: extra in public_html/findcards/index.php on line 37 now I can eliminate the messages with an @ but it isnt giving me any data. If I switch $row['year'] with $row[1] it works out fine. what is the deal? tia Quote Link to comment https://forums.phpfreaks.com/topic/51419-mysql-get-data-issue/ Share on other sites More sharing options...
trq Posted May 15, 2007 Share Posted May 15, 2007 Use mysql_fetch_assoc() instead of mysql_fetch_row(). Quote Link to comment https://forums.phpfreaks.com/topic/51419-mysql-get-data-issue/#findComment-253252 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.