Dfrtbx Posted November 24, 2009 Report 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 Report Share Posted November 24, 2009 (edited) its gotta be something with that $q string or something in that directory. Edited November 24, 2009 by thescientist Link to comment Share on other sites More sharing options...
Ingolme Posted November 24, 2009 Report 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 Report 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
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now