Agony Posted May 24, 2014 Share Posted May 24, 2014 (edited) 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 May 24, 2014 by Agony Link to comment Share on other sites More sharing options...
Ingolme Posted May 24, 2014 Share Posted May 24, 2014 I think errors might not show up until you actually execute the query. Link to comment Share on other sites More sharing options...
Agony Posted May 24, 2014 Author Share Posted May 24, 2014 (edited) EDIT: Apparently prepare always returns false according to the manual.. which sucks. Guess just gotta write custom message as an error. Edited May 24, 2014 by Agony Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now