Below is the error I am getting: :?
You have an error in your SQL syntax near 'WHERE adminID=1' at line 1
I have included some of the form code below, it seems to function but I keep getting the above error message and don't understand it, i have
been trying to reaserch the error online but have not been able find a solution , please accept my appologies for my vagueness, I
am a beginner... If anyone can assist me with finding the problem it would be greatly appreciated.
Here is the top part of the code for my form i am trying to use:
<?php
if($_SESSION["loggedon"] != "virtualstore") exit;
$success=TRUE;
$sSQL = "SELECT adminEmail, adminStoreURL, adminProdsPerPage, adminSubCats, adminEmailConfirm, adminCountry, adminUnits,
adminDelUncompleted, adminStockManage FROM admin WHERE adminID=1";
$result = mysql_query($sSQL) or print(mysql_error());
$rsAdmin = mysql_fetch_assoc($result);
mysql_free_result($result);
if(@$POST["posted"]=="1"){
$sSQL = "UPDATE admin SET adminEmail='" . @$POST["email"] . "',adminStoreURL='" . @$_POST["url"] .
"',adminProdsPerPage='" . @$POST["prodperpage"] . "',adminSubCats=" . @$POST["subcats"] . ",adminCountry=" .
@$POST["countrySetting"] . ",adminDelUncompleted=" . @$POST["deleteUncompleted"] . ",adminStockManage=" .
@$POST["stockManage"] . ", ";
if(@$POST["emailconfirm"]=="ON")
$sSQL .= "adminEmailConfirm=1, ";
else
$sSQL .= "adminEmailConfirm=0, ";
$sSQL .= "adminUnits=" . @$_POST["adminUnits"];
$sSQL .= " WHERE adminID=1";
mysql_query($sSQL) or print(mysql_error());
print "<meta http-equiv=\"refresh\" content=\"3; url=admin.php\">";
}else{
$sSQL = "SELECT countryID,countryName FROM countries WHERE countryLCID<>'' ORDER BY countryOrder DESC,
countryName";
$rsCountry = mysql_query($sSQL) or print(mysql_error());
}
?>
<table border="0" cellspacing="<?php print $maintablespacing?>" cellpadding="<?php print $maintablepadding?>"
width="<?php print $maintablewidth?>" bgcolor="<?php print $maintablebg?>" align="center">
<?php if(@$_POST["posted"]=="1" && $success){ ?>
<tr>
<td width="100%">
<table width="<?php print $innertablewidth?>" border="0" cellspacing="<?php print $innertablespacing?>"
cellpadding="<?php print $innertablepadding?>" bgcolor="<?php print $innertablebg?>">
<tr>
<td width="100%" colspan="2" align="center"><br><b>Update Successful !</b><br><br>You will now be forwarded
to the admin home page.<br><br>
If that does not happen automatically then please <A
href="file:///C|/Dreamweaver%20Templates/DW%20Virtual%20Soft%20Ecomm%20Plus/vsadmin/inc/admin.php"><b>click
here</b></a>.<br>
<br>
<img
src="file:///C|/Dreamweaver%20Templates/DW%20Virtual%20Soft%20Ecomm%20Plus/vsadmin/images/clearpixel.gif" width="350"
height="1">
</td>
</tr>
</table></td>
</tr>
<?php }else{ ?>
<tr>
<form method="POST" action="adminmain.php">
<td width="100%">
<input type="hidden" name="posted" value="1">
<table width="<?php print $innertablewidth?>" border="0" cellspacing="<?php print $innertablespacing?>"
cellpadding="<?php print $innertablepadding?>" bgcolor="<?php print $innertablebg?>">
<tr>
<td width="100%" colspan="2" align="center"><br>
<b>Use this page to update your store admin settings.</b><br>
</td>
</tr>
<?php if(! $success){ ?>
<tr>
<td width="100%" colspan="2" align="center"><br>
<font color="#FF0000"><?php print $errmsg?></font> </td>
</tr>
<?php } ?>
<tr>
<td width="100%" align="center" colspan="2">Which country settings
do you wish to use for currency symbols etc.</td>
</tr>
<tr>
<td width="100%" align="right"><b>Country Settings: </b> </td>
<td width="50%" align="left"><select name="countrySetting" size="1">
<?php
while($rs = mysql_fetch_assoc($rsCountry)){
print "<option value='" . $rs["countryID"] . "'";
if($rsAdmin["adminCountry"]==$rs["countryID"]) print " selected";
print ">". $rs["countryName"] . "</option>\n";
}
?>
</select></td>
</tr>
<tr>
<td width="100%" align="center" colspan="2"><hr width="70%">
Would you like to receive a confirmation email when orders come
in.</td>
</tr>
<tr>
<td width="100%" align="right"><b>Email confirmation: </b> </td>
<td width="50%" align="left"><input type="checkbox" name="emailconfirm" value="ON" <?php
if((int)($rsAdmin["adminEmailConfirm"])==1) print "checked"?>></td>
</tr>
<tr>
<td width="100%" align="center" colspan="2"><hr width="70%">
The email address to which confirmation emails should be sent.</td>
</tr>
<tr>
<td width="100%" align="right"><b>Email address: </b> </td>
<td width="50%" align="left"><input type="text" name="email" size="<?php print atb(30)?>" value="<?php print
$rsAdmin["adminEmail"]?>"></td>
</tr>
<tr>
<td width="100%" align="center" colspan="2"><hr width="70%">
The Store URL should be the base URL of your store, including directory
name if you have placed your store in a sub directory. For example<br>
<b>