lambada
New Member
- Messages
- 2,444
- Reaction score
- 0
- Points
- 0
Little error in my PHP code I can't for the life of me figure out.
Anyone out there know how to solve it??
Heres the error:
Here's the code
Any ideas?
Thanks
lambada (BTW: I removed the db details. I'm not THAT idiotic
EDIT: Apparently I am - I forgot to say which was line 5. *looks sheepish* Line 5 is the
line
Anyone out there know how to solve it??
Heres the error:
Catchable fatal error: Object of class mysqli could not be converted to string in /home/lambada/public_html/secretconfessions/dev/includes/entry/view.php on line 5
Here's the code
PHP:
$db = mysqli_connect("localhost", "USER", "PASS", "DB") or die("Database Unavailable");
$query = "SELECT id, text, datetime, ipaddress, user FROM entries WHERE moderated = 1 ORDER BY id DESC";
$selectentries = mysqli_query("$db", "$query");
Any ideas?
Thanks
lambada (BTW: I removed the db details. I'm not THAT idiotic
EDIT: Apparently I am - I forgot to say which was line 5. *looks sheepish* Line 5 is the
PHP:
$selectentries = mysqli_query("$db", "$query");
Last edited: