Jump to content

[SOLVED] execution of simultaneous mysql query using php


starrylitgal

Recommended Posts

hi!

i m having problem executing two queries together through my PHP code.

Following is the code:

$q1="CREATE TABLE `db`.`tb1`(`col1` tinyint(12),`col2` varchar(12)); 
CREATE TABLE `db`.`tb2` (`col1` int(12),`col2` varchar(12))";
mysql_query($q1) or die(mysql_error());

 

Is there nething wrong?

This query is working properly when executed using phpmyadmin....

it always shows the following error:

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'CREATE TABLE `db`.`tb2` at line 2'

 

i tried to run it individually i.e. create these 2 tables (thru php code) separately  like this :

mysql_query($q1);
mysql_query($q2);

 

[$q2 being the second create table statement]

and it successfully executed...

 

but im not able to do it simultaneously in one query....wht is wrong???

 

i m not willing to run it separately coz i hav almost 28 queries to run and it wud mean running 28 queries separately....it wud be a long code...n as per my requirement i hav to chk its status of success for other operations...so..

 

plz does ne1 hav ne solution to this problem..!

 

thnx!

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.