i have this simple script that recieve name/value pairs from a flash movie that is suppose to update a feild in a database table. here is it:
PHP Code:
<?php
include_once("conn.php");
$active = ($_GET["active"]);
$ipc = ($_GET["ipc"]);
$ipc = ereg_replace("[^A-Za-z0-9 ]", "", $ipc);
$active = ereg_replace("[^A-Za-z0-9 ]", "", $active);
// This is the SQL statement that will update the appropriate table in the database
$query = "UPDATE ipcinfo SET active ='$active', WHERE ipc ='$ipc' , LIMIT = 1";
if (!$result = mysql_query($query)) {
die(mysql_error());
}
$num_result = mysql_num_rows($result);
if ($num_result == 1) {
if($row = mysql_fetch_array($result));
echo"success= 1";
echo"ipc=$ipc";
echo"active=$active";
}
else
{
echo( "success=0" );
}
// Clean up
mysql_close($dblink);
?>
when i run it 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 'WHERE ipc ='' , LIMIT = 1' at line 1"
i am not a php/mysql buff so therefore i dont know what is wrong, because it seems ok. Any help is appreciated.