So I use this code to connect to MySQL and execute multiple statements:
$connect=@mysql_connect($host,$user,$pass,false,65536) or die("Can't connect");
mysql_select_db($base,$connect);
When connected I do:
mysql_query("CREATE TABLE IF NOT EXISTS tablename ...;
INSERT INTO tablename ...;");
I use this code to execute backup files containing the same code above (
=new line). When I run this script on my webpage (hosted server) it works but on my local computer where I use XAMPP it shows an 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 'INSERT INTO tablename' at line 2
I have checked php.ini and I have safe_mode = Off
and sql.safe_mode = Off
too.
Any ideas what am I missing?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…