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

Recommended Answers

All 3 Replies

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

Thanks..

Exactly...

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.