jimfog Posted March 9, 2015 Share Posted March 9, 2015 I have the following prepared statement json_encode error checking code: ...$stmt->bind_param('siisi',$name,$start,$end,$origin,$staf,$bookedfor); $stmt->execute(); if($stmt->errno!==0) {printf("Error-execution failed : %s.n", $stmt->error); return false; }... How I could possibly json_encode the above error? The point here is that a conditional "waits" in the client to evaluate such an error. I cannot do that with the way the code is above. I do see the warning message being sent from the message but it is worthless...I want to take a specific action based on it. Link to comment Share on other sites More sharing options...
justsomeguy Posted March 9, 2015 Share Posted March 9, 2015 Why do you need to JSON-encode a string? You could put it in an object or array and encode that I guess. But if you only need a string I don't see a reason to put it in a data structure and then encode it. 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