aurawire Posted August 27, 2013 Share Posted August 27, 2013 Hey everybody, I have searched the entire internet pretty much to try and figure out why this code doesn't work. It used to work, but once I moved it to another server it gives me this error: Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in Here is the code: $requests = mysql_query("SELECT * FROM users, friendrequests WHERE touser='$username' AND fromuser=username ORDER BY requestid ASC"); while($reqs = mysql_fetch_array($requests)){ } if anybody could help me... It seems to not want to connect to multiple databases at all. Could it be a php.ini thing? I'm using XAMPP 1.7.2 btw, all the new xampps error out like crazy Quote Link to comment Share on other sites More sharing options...
requinix Posted August 28, 2013 Share Posted August 28, 2013 (edited) Temporarily use $requests = mysql_query("SELECT * FROM users, friendrequests WHERE touser='$username' AND fromuser=username ORDER BY requestid ASC") or die(mysql_error());and find out why your query failed. (Which is what happened.) Also, 1. The mysql extension and mysql_* functions are dead. Switch to mysqli or PDO. 2. Use a real JOIN instead of the comma. SELECT fields FROM users JOIN friendrequests ON whatever conditions to join them together WHERE the rest of your conditions... ORDER BY requestid ASC I'm using XAMPP 1.7.2 btw, all the new xampps error out like crazyGood. It's telling you about all the things going wrong. Edited August 28, 2013 by requinix Quote Link to comment Share on other sites More sharing options...
aurawire Posted August 28, 2013 Author Share Posted August 28, 2013 I actually got it working, thanks It was because the collations were on swedish instead of general 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.