Jump to content

problem with INSERT queries


fxuser

Recommended Posts

Hello,

 

i just realised that when i do 2 INSERTs in the same time in the database only the one of them appears to be inside andn the other just dont get in..

the code is simply

$query1 = "INSERT INTO table1 VALUES('','$stuff1','$stuff2')";
$result1 = mysql_query($query1) or die(mysql_error());
$query2 = "INSERT INTO table2 VALUES('','$stuff2','$stuff2')";
$result2 = mysql_query($query2) or die(mysql_error());

 

all names are random.

 

i see that sometimes both will be executed but other times only 1 will go through...

 

what can cause this?

Link to comment
https://forums.phpfreaks.com/topic/226778-problem-with-insert-queries/
Share on other sites

Is that the actual code you're using?

 

no its not , its the same concept , simple INSERT into database in 2 different tables

 

one look like:

$insert_pms_data = ("INSERT INTO my_pm_data VALUES('','$msg_id','$email','$explode_recievers[$msg]','0','1','0','0','0','0','0','0')");

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.