Jump to content

mysqli prepare() wont return errors


Agony

Recommended Posts

So im trying to set up error handling for the:

$result = $db->prepare($this->query);

However - if i break the input query, all i get is NULL - no error from prepare.

if i var_dump ($result) - its NULL, If i var_dump() the returned $db->prepare($this->query) - its also all NULL - no errors or anything.

object(mysqli)[2]  public 'affected_rows' => null  public 'client_info' => null  public 'client_version' => null  public 'connect_errno' => null  public 'connect_error' => null  public 'errno' => null  public 'error' => null  public 'error_list' => null  public 'field_count' => null  public 'host_info' => null  public 'info' => null  public 'insert_id' => null  public 'server_info' => null  public 'server_version' => null  public 'stat' => null  public 'sqlstate' => null  public 'protocol_version' => null  public 'thread_id' => null  public 'warning_count' => null

Query is:

"UPDATE SELECT * FROM posts" 

so that's clearly wrong and should fail.

How am i supposed to catch any query caused errors from it?

Edited by Agony
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...