lamajlooc Posted October 25, 2006 Share Posted October 25, 2006 First, I'd like to say thanks to all those who responded to my other two questions. Here's one that's bizarre though.I'm getting an error on the following code:$result = @mysql_query ($query); $row = mysql_fetch_array ($result, MYSQL_NUM); if ($row) { $_SESSION['date_last_in'] = $row[0]; }The error is "Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource"The wierd things are: a) according to php.net the syntax is CORRECT (unless I'm syslexic) and I've used this same code before with no troubles.Any ideas? Quote Link to comment Share on other sites More sharing options...
Stooney Posted October 25, 2006 Share Posted October 25, 2006 [code]$result = @mysql_query ($query);if($result) { $row = mysql_fetch_array ($result, MYSQL_NUM); if ($row) { $_SESSION['date_last_in'] = $row[0]; }}else{ //query didn't work, therefore $result is not a "valid MySQL result resource"}[/code]Basically you need to make sure you're connected with your database properly and that your query is valid. Quote Link to comment Share on other sites More sharing options...
BrianPeiris Posted October 25, 2006 Share Posted October 25, 2006 you might also want to remove the '@' (at sign) in front of 'mysql_query' during testing, so that you see any and all errors that might be suppressed. Docs on Error Control Operators:[url=http://|http://ca3.php.net/manual/en/language.operators.errorcontrol.php]|http://ca3.php.net/manual/en/language.operators.errorcontrol.php[/url] Quote Link to comment Share on other sites More sharing options...
JasonLewis Posted October 25, 2006 Share Posted October 25, 2006 whats the query to btw...? Quote Link to comment Share on other sites More sharing options...
lamajlooc Posted October 25, 2006 Author Share Posted October 25, 2006 Fixed the problem, I was dyslexic. Thanks guys. 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.