Page 1 of 1

error in mysql syntax

Posted: Wed Aug 01, 2007 2:04 am
by m2babaey
Hi
I can't understand why this code is sending error:

Code: Select all

<?php
mysql_connect('localhost','root','');
mysql_select_db('hameddb');
$name="Javad";
$fn="Ali";
$shsh="11542";
$mc="0794956912";
$age="20";
$cm="bichare";
mysql_query("INSERT INTO `details` (name, father_name, shsh, mellicode, age, comments) VALUSE ('$name', '$fn' ,'$shsh', '$mc', '$age', '$cm')") or die(mysql_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 'VALUSE ('Javad', 'Ali' ,'11542', '0794956912', '20', 'bichare')'

Posted: Wed Aug 01, 2007 2:42 am
by waqas_punjabian
You have error in here:

Code: Select all

VALUSE ('$name', '$fn' ,'$shsh', '$mc', '$age', '$cm')")
use VALUES intead of VALUSE


cheers

Posted: Wed Aug 01, 2007 2:42 am
by Christopher
It should be "VALUES".

Posted: Wed Aug 01, 2007 3:57 am
by tansoft
there is a spelling mistake ... use "values"