moon 111 Posted August 11, 2008 Share Posted August 11, 2008 For some reason the following generates this error: Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in ... on line 18 <?php $q = "SELECT * FROM category"; $r = mysql_query($q); // Line 18 ?> and I connect to the database earlier on: <?php $server = '**'; $dbuser = '**'; $dbpass = '**'; $db = '**'; mysql_connect($server, $dbuser, $dbpass) or die(mysql_error()); mysql_select_db($db) or die(mysql_error()); ?> What is the problem? Link to comment https://forums.phpfreaks.com/topic/119169-solved-supplied-argument-is-not-a-valid-mysql-resource/ Share on other sites More sharing options...
discomatt Posted August 11, 2008 Share Posted August 11, 2008 $r = FALSE mysql_query() will return FALSE on an non-successful query. Use mysql_error() to check to see what's going wrong. Link to comment https://forums.phpfreaks.com/topic/119169-solved-supplied-argument-is-not-a-valid-mysql-resource/#findComment-613667 Share on other sites More sharing options...
moon 111 Posted August 11, 2008 Author Share Posted August 11, 2008 Thank you very much. I simply forgot to upload a file after updating it... Link to comment https://forums.phpfreaks.com/topic/119169-solved-supplied-argument-is-not-a-valid-mysql-resource/#findComment-613686 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.