bravo14 Posted March 1, 2009 Share Posted March 1, 2009 Hi guys I have the following error Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/sites/yardleyhc.co.uk/public_html/bravo14/main.php on line 31 when using the following code, the database connection has already been made before this point <?php $team = ('SELECT * FROM `tbl_team_menu` where `page` <>"main.php" and `team_id`\'' . $_GET['team_id'] . '\''); $teamresult=mysql_query($team); while($teamrow = mysql_fetch_array($teamresult)) { echo('<a href="'.$teamrow['page'].'?team_id='.$teamrow['team_id'].'"><img src="images/menu/'.$teamrow['button'].'" border="0"></a>'); } ?> Can anyone point out where I have gone wrong? Link to comment https://forums.phpfreaks.com/topic/147471-mysql_fetch_array/ Share on other sites More sharing options...
Mchl Posted March 1, 2009 Share Posted March 1, 2009 This usually means, that your query dod not execute correctly. Try displaying mysql_error() change $teamresult=mysql_query($team); to $teamresult=mysql_query($team) or die(mysql_error().": $team"); Link to comment https://forums.phpfreaks.com/topic/147471-mysql_fetch_array/#findComment-774065 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.