top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

How to get MYSQL error in different environments?

0 votes
356 views

I have a mysql query that would not execute and I would like to display information about why that's happening.

$myQuery= $mysqli->query("UPDATE table SET id = 1 WHERE id = 3");
if(!$myQuery) //If query couldnt be executed
{
echo $mysqli->error; //Display information about why wasnt executed (eg. Error: couldnt find table)
}
posted Apr 10, 2017 by Deepa

Looking for an answer?  Promote on:
Facebook Share Button Twitter Share Button LinkedIn Share Button

Similar Questions
0 votes

I am using MySQL Proxy. When I type command like "show databa;" I should get error messages from MySQL server, which is forwarded by MySQL Proxy. How can I access this error message, modify it, and then send the modified error message to the client?

...