Jump to content

Mysqli Prepared Statements Error Handling


mds1256

Recommended Posts

Hi

 

Having a bit trouble understanding the best way to check if the SQL statement has worked.

 

At the moment check the statement object if error then display bespoke error, if that passes then I check the statement object execute method and then if that fails show the same bespoke error for that form.

 

so I have two if statements, which gets messy if I am calling multiple sql statements within the same php function as I end up with lots of nested if statements.

 

Is there a better way of doing this?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.