oliver12 Posted March 29, 2010 Share Posted March 29, 2010 After I display an image from the database, the table below it doesn't display the data. (the data is from the same database) What do you think the problem is? <table border="1"> <tr> <th align="left">Profile Picture</th> </tr> <?php //Display result while($row = mysql_fetch_array($result)) { ?> <tr> <td><img src="files/<?=$row["file"]?>" height="200" width="150"</img></td> </tr> <?php } ?> </table> <table border="1"> <tr> <th align="left">Player User Name</th> <th align="left">First Name</th> <th align="left">Last Name</th> </tr> <?php while($row = mysql_fetch_array($result)) { ?> <tr> <td><?=$row["player_id"]?></td> <td><?=$row["player_name"]?></td> <td><?=$row["player_surname"]?></td> </tr> <?php } ?> Quote Link to comment https://forums.phpfreaks.com/topic/196829-after-displaying-avatar-cant-display-data/ Share on other sites More sharing options...
PFMaBiSmAd Posted March 29, 2010 Share Posted March 29, 2010 After you iterate over the result set, the result pointer is after the last row of data. You must reset the result pointer before you can iterate over the result set again - http://php.net/mysql_data_seek Quote Link to comment https://forums.phpfreaks.com/topic/196829-after-displaying-avatar-cant-display-data/#findComment-1033285 Share on other sites More sharing options...
oliver12 Posted March 29, 2010 Author Share Posted March 29, 2010 Thanks, took me a while to implement but i got it Quote Link to comment https://forums.phpfreaks.com/topic/196829-after-displaying-avatar-cant-display-data/#findComment-1033303 Share on other sites More sharing options...
teamatomic Posted March 29, 2010 Share Posted March 29, 2010 This is not a valid image tag <img src="files/<?=$row["file"]?>" height="200" width="150"</img> An image tag does not have a closing tag <img src="image.png"> HTH Teamaotmic Quote Link to comment https://forums.phpfreaks.com/topic/196829-after-displaying-avatar-cant-display-data/#findComment-1033304 Share on other sites More sharing options...
Alex Posted March 29, 2010 Share Posted March 29, 2010 This is not a valid image tag <img src="files/<?=$row["file"]?>" height="200" width="150"</img> An image tag does not have a closing tag <img src="image.png"> HTH Teamaotmic If you want to nitpick that's a valid img tag either. In the img tag the alt attribute is required, and if it's XHTML it must self-close. Quote Link to comment https://forums.phpfreaks.com/topic/196829-after-displaying-avatar-cant-display-data/#findComment-1033305 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.