Hey guys,
I'm trying to properly handle a call to my database with an intentionally invalid search parameter. I want to be able to reprompt my user to enter a valid name when they enter an invalid name, however when I use an invalid name the program doesn't compile and I get this error:
Catchable fatal error: Object of class MDB2_BufferedResult_mysql could not be converted to string in /var/www/NovaDB/emptysettest.php on line 9
An example of my code:
<?php
//assume proper db connection
$test = $db->query("SELECT * FROM ShareholderNames WHERE First_Name = 'Shenabablebooblekazam'");
echo "...";
echo "$test";
echo "...";
?>
Assuming that 1)Shenablebooblekazam is not in the db and 2)that my First_Name field is big enough to hold that name if it was in the field (not sure if that matters).
I would appreciate any suggestions you might have on how to handle this