Dfrtbx Posted November 24, 2009 Share Posted November 24, 2009 This has worked fine in scripts on other pages, but does not want to work here: $q = "SELECT * FROM users AS u INNER JOIN referrers AS r ON u.refID = r.refID INNER JOIN users AS ur ON r.userID = ur.userID";$r = mysqli_query ($q, $dbc); Where $dbc connects to the MySQL database. The error I keep receiving is "Warning: mysqli_query() expects parameter 1 to be mysqli, string given in C:\xampp\htdocs\ ..." Link to comment Share on other sites More sharing options...
thescientist Posted November 24, 2009 Share Posted November 24, 2009 its gotta be something with that $q string or something in that directory. Link to comment Share on other sites More sharing options...
Ingolme Posted November 24, 2009 Share Posted November 24, 2009 According to the manual, you either use it with a string like this: $mysqli = new mysqli("localhost", "my_user", "my_password", "world");$mysqli->query("SELECT * FROM table") Or you add the string as the second parameter: $link = mysqli_connect("localhost", "my_user", "my_password", "world");mysqli_query($link, "SELECT * FROM table") Link to comment Share on other sites More sharing options...
Dfrtbx Posted November 24, 2009 Author Share Posted November 24, 2009 Interesting. I had the variables in the opposite order. The punchline is that I had checked to make sure that they were in the correct order numerous times, but somehow managed to overlook it repeatedly. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.