I'm having some problems figuring out why the following doesn't insert correctly.
The error I get is:
You have an error in your SQL syntax near '' at line 1
I'm 100% it's the below query (see $query) because it's the only query I have on that particular page.
Thanks,
KABOOM.
//Data passes all checks, insert the data into clients
$arraysize = count($SRegion); //get number elements from cities checkbox. This is OK
print "DEBUG: $User, $Password, $Email, $FirstName, $LastName<BR>"; //THis is OK
for($j=0; $j<$arraysize; $j++)
{
$query = "INSERT INTO special (CUserName, SPassword, SEmail, SFirstName, SLastName, SRegion) VALUES ('$User','$Password','$Email','$FirstName','$LastName','$SRegion[$j]'";
print "$query<BR>"; //THis is OK
$insertresult = mysql_query($query);
}
if(!$insertresult)
die("<B>ERROR:</b> Insertion failed. ".mysql_error());