Hi frnds..
this query having a small error at where condition....plz solve this..

$sql="insert into customer (sizeindustry) values ('$sindustry') where (sno = '$sno')";
echo $sql;

mysql_query($sql)or die(mysql_error());

$sql= insert into customer (sizeindustry) values ('Small') where (sno = '4')

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 (sno = '4')' at line 1

Sounds link you want to update existing data.

If you are updating chane "INSERT" to "UPDATE and remove INTO e.g $sql= UPDATE customer SET sizeindustry = '$sindustry' WHERE sno = '$sno' limit 1"; Hope this helps

hi
we can not use where condition in insert query
if u want to modified the some field value than u must use
update query

$sql="update customer  set  sizeindustry='$sindustry' where sno = '$sno' ";

echo $sql;

mysql_query($sql)or die(mysql_error());

i hope this problem may be solve.
thanks

This question has already been answered. Start a new discussion instead.