I keep getting the same error:
This code works just fine on another site, and all the other php pages work just fine. But this one is driving me nuts trying to figure out the problem.
Unable to update dataYou have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'ssl='O',ecomme rce='O',reselle r='-',dedicated='-',vps='x',affil iate='CJ',green ='-' at line 1
Code:
<?php
$hostname=$_POST['hostname'];
$url=$_POST['url'];
$established=$_POST['established'];
$price=$_POST['price'];
$diskspace=$_POST['diskspace'];
$bandwidth=$_POST['bandwidth'];
$econplan=$_POST['econplan'];
$maillists=$_POST['maillists'];
$platform=$_POST['platform'];
$ssl=$_POST['ssl'];
$ecommerce=$_POST['ecommerce'];
$reseller=$_POST['reseller'];
$dedicated=$_POST['dedicated'];
$vps=$_POST['vps'];
$affiliate=$_POST['affiliate'];
$green=$_POST['green'];
$au=$_POST['au'];
$ca=$_POST['ca'];
$uk=$_POST['uk'];
$notes=$_POST['notes'];
include("dbinfo.inc.php");
$query="UPDATE webhosts SET hostname='$hostname',url='$url',established='$established',price='$price',diskspace='$diskspace',bandwidth='$bandwidth',econplan='$econplan',maillists='$maillists',platform='$platform',ssl='$ssl',ecommerce='$ecommerce',reseller='$reseller',dedicated='$dedicated',vps='$vps',affiliate='$affiliate',green='$green',au='$au',ca='$ca',uk='$uk',notes='$notes' WHERE hostname='$hostname'";
@mysql_select_db($database) or die( "Unable to select database" . mysql_error());
mysql_query($query) or die("Unable to update data" . mysql_error());
echo "<center><table><tr><td>";
echo "<h2>Record Updated</h2>";
echo "</td></tr></table></center>";
mysql_close();
?>
Comment