In this block, $stmt returns not false as expects, $bind is true, but when I get to $stmt->execute(), it exits, and returns neither true nor false. The only time I can get false out of it, is if I use some variable in the argument for execute per it's documentation, but I've never used an argument in an execute call, and I can't find an example of anyone else using one except in procedural prepared statements. I don't know if I'm missing something. Anyone have any ideas?
$stmt = $mysqli->prepare("SELECT ... FROM `table` WHERE `tid` = ?");
if ($stmt !== FALSE) {
echo 'Statement was true.';
$bind = $stmt->bind_param('s', $this->tid);
echo 'after bind';
if ($bind)
echo 'bind was good ';
else
echo 'bind was bad';
$exec = $stmt->execute();
if ($exec)
echo 'exec was good';
else
echo 'exec was bad';
echo 'after execute';
// etc.
} else {
// rest of code
}
@tntu's accepted answer and following comments got me on the right track for solving this problem. [link]http://stackoverflow.com/questions/5580039/fatal-error-uncaught-exception-mysqli-sql-exception-with-message-no-index-us
MySQL can do a lot of error reporting, and I had set mysqli_report(MYSQLI_REPORT_ALL) set earlier in the stack and in the function in question in order to figure out some other problems. At any rate, setting mysqli_report(MYSQLI_REPORT_OFF) enabled the execute to run as intended, and not bog php down with warnings, and errors.