How do I get back only one row in my query search using mysqli_
I've been reading about here:
Here
where it says that I can do a query like this:
$name = $mysqli->query("SELECT name FROM contacts WHERE id = 5")->fetch_object()->name;
but it does not work for me.
this is what I have:
$connection= mysqli_connect("localhost", "root", "", "my_db");
using the same principle as the one in the page:
echo $result = $connection->query("SELECT organization FROM organizations_table WHERE status !=0 AND token=".$TOKEN)->fetch_object()->organization;
I suppose fetch_object()->organization;
is the name of my table field.
Or is there a better way to do this, not that this way is working for me. I'm using procedural php with mysqli_