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? Quote Link to comment 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"); Quote Link to comment 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.