I have the feeling this is an easy to fix problem, but I can't find the answer. I'm trying to get a specific value from my database and then print it to the screen but I keep getting the following error:
Object of class mysqli_result could not be converted to string
I'm pretty sure it's because i'm requesting an entire row instead of a value. I'm just not sure how to fix it, i've tried a few options but nothing works. My code:
<?php
$host = 'localhost';
$user = 'root';
$pass = '';
$db = 'mydatabase';
$connection = new mysqli ($host, $user, $pass, $db) or die ("Databse connection failed");
$sql = "SELECT waitlist_text FROM texts";
$waitlist_text = $connection->query($sql);
echo $waitlist_text
?>
The database table is called 'texts' and has 2 columns: 'id' 'waitlist_text'. I would like the text thats under column waitlist_text on id 1