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 'sum( ) VALUES ()' at line 1
This is my code
can some 1 help me about this problem,
i used to fix it by changing the name, but now. it not success any more.
thz.
This is my code
Code:
<?php //make conection $name=$_POST['name']; $cloth=$_POST['cloth']; $bag=$_POST['bag']; $connection = mysql_connect("localhost", "root","") or die("Could not connect to MYSQL"); $selection=mysql_select_db("addname") or die ("Unable to select database"); $sql="SELECT * from sum WHERE name like '$name'"; $result= mysql_query($sql) or die(mysql_error()); $record = mysql_num_rows($result); if ($record == 0) { $sql = "INSERT INTO sum( name, cloth, bag) VALUES ('$name', '$cloth', '$bag')"; $result= mysql_query($sql); if ($result) { echo "Record added: $name $cloth $bag "; } else { die(mysql_error()); } } else echo "<br>record already exist"; ?>
can some 1 help me about this problem,
i used to fix it by changing the name, but now. it not success any more.
thz.
Comment