Hi,
What is wrong with this sql? It fails in php but doesn't fail in phpmyadmin!
Thanks
<?php
$connection=mysql_connect("localhost", "root", "");
if(!$connection) {
die('Could not connect: ' . mysql_error());
} else {
mysql_select_db("test", $connection) or die('Could not select the table.');
$sql="BEGIN;\n";
$sql.="SET AUTOCOMMIT=0;\n";
$sql.="INSERT INTO table1 (id, name) values (1, 'person1');\n";
$sql.="INSERT INTO table2 (id, name) values (2, 'person2');\n";
$sql.="INSERT INTO table3 (id, name) values (3, 'person3');\n";
$sql.="COMMIT;";
/*echo "<pre>";
echo $sql;exit;*/
$runSql=mysql_query($sql);
if($runSql) {
echo "Done";
} else {
echo "Failed";
}
}
?>