I am less familiar with mysqli, and I write Procedure style, not Object orientated style. I know of some of the benefits of object orientated style but it trips my mind so I am slow to adjust with it. My policy is, if I cannot support it, I don't write it.
So... I have a simple function which contains the following:
mysqli_query( $DB, "CREATE TABLE $TABLE ( $SCHEMHA )" );
if (mysqli_connect_errno()) {
printf("Connect failed: %s
", mysqli_connect_error());
exit();
}
The query works when creating the table, so long as I don't have a bug in my schema. If my schema fails, my conditional statement does not trap the failure (thus the connect failed message never gets called).
Where am I going wrong?
My goal is to be able to exit/stop/end on selective errors. So for example, if a table already exists (errno 1050), I am comfortable ignoring that error, however if there is an error 1072 (Key column 'whatever' doesn't exist in table) I would like to stop processing.
All help appreciated...