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!

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.