PDA

View Full Version : mySQL Help



JonnyH
November 18th, 2007, 12:21
I'm doing an install script for the cP Addon i'm doing. It gets the SQL from a txt, replaces the variables with details and posts it in a query but I get this 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 cp2_subdomains (domain) VALUES('kxs.in'); INSERT INTO cp2_subd' at line 3
I've tried a lot but don't know what's up. Here's the php code:

//Execute SQL
$ssql = file_get_contents("subdomains.txt");
$ssql = preg_replace("/%PRE%/si",$_POST['pre'],$ssql);
mysql_query($ssql, $con) or die(mysql_error());

Kirrus
November 20th, 2007, 10:36
Try adding a space between VALUES and the open bracket ('kxs.in')