Using mySQL error information

I’m getting an error with a CREATE table query. I know what the problem is (I’m creating tables dynamically and now and then a name slips through with a space or other illegal character.)
The error occurs in a function and what I want to know is, is there a system field/flag which I can use after the return in an if statement to detect whether an error has taken place or not.
Thanks,
Mike

May I ask why you’re doing this? Usually when one does stuff like this something is wrong with their DB design.

The situation has been resolved. Thanks anyway.

Hi,

It was because I wanted to see if there had been a query error situation in a separate function but the situation has resolved itself. Thanks for your time.
Mike

What function? A PHP function?