shealtiel
shealtiel

Reputation: 8388

How can I know what went wrong in the execution of my sql statement

I execute a mysql statement via php, no exception is thrown, but nothing happens

The statement is actually multiple statement set separated by ; which should have created multiple tables

How can I check what went wrong?

Upvotes: 1

Views: 53

Answers (3)

Nicola Cossu
Nicola Cossu

Reputation: 56377

You need to call mysql_query() for each query. You can't put them all within a single call, even though they are separated by ";"

Upvotes: 0

Pascal MARTIN
Pascal MARTIN

Reputation: 401062

It depend on the API you are using ; but those are generally providing a way of getting an error message, when a query fails.

See, typically :


Also, to give some information that's probably more related to your question : you are saying *(quoting)* :

The statement is actually multiple statement set separated by ; ...

This is typically not supported by default functions.


For instance, the documentation of [`mysql_query()`][1] states *(quoting)* :

multiple queries are not supported

If you are using mysqli_* functions, take a look at mysqli::multi_query().

Upvotes: 3

catinred
catinred

Reputation: 329

I would suggest you running the sql statement in phpmyadmin to see what happens.

Upvotes: 1

Related Questions