I agree this is a valid format. People should check the manual before making statements that are untrue to the list server. Axel did you get an error message or just no update? -----Original Message----- From: Nitin Mehta [mailto:nitinmehta@xxxxxxxxxxxx] Sent: 26 February 2004 12:26 To: Erwin Kerk; nfzgrld@xxxxxxxxxx; PHP DB Subject: Re: What's wrong with this query? exactly, i'm using it for more than a year ----- Original Message ----- From: "Erwin Kerk" <erwin@xxxxxxxxxxx> To: <nfzgrld@xxxxxxxxxx>; "PHP DB" <php-db@xxxxxxxxxxxxx> Sent: Thursday, February 26, 2004 5:36 PM Subject: Re: What's wrong with this query? > Viorel Dragomir wrote: > > > I'm using MySQL for about 2 years and never heard about this kind of INSERT. > > Is not SQL compliant neither. > > > > YOU CAN NOT MAKE : INSERT INTO table SET var=1 [as I know] > > As a matter of fact it IS possible, according to the MySQL manual on > http://www.mysql.com/doc/en/INSERT.html > > [snip] > INSERT [LOW_PRIORITY | DELAYED] [IGNORE] > [INTO] tbl_name [(col_name,...)] > VALUES ((expression | DEFAULT),...),(...),... > [ ON DUPLICATE KEY UPDATE col_name=expression, ... ] > or INSERT [LOW_PRIORITY | DELAYED] [IGNORE] > [INTO] tbl_name [(col_name,...)] > SELECT ... > HERE-> or INSERT [LOW_PRIORITY | DELAYED] [IGNORE] > [INTO] tbl_name > SET col_name=(expression | DEFAULT), ... > [ ON DUPLICATE KEY UPDATE col_name=expression, ... ] > [/snip] > > I use this syntax all the time, and always without any trouble. > > > > @Axel: > > try this: > > $logit = mysql_query("INSERT INTO log SET term='$search', > returns='$arrayword', time=CURTIME(), date=CURDATE(), ip='$ip'") or > die(mysql_error()); > > to see what is going wrong... > > > > Erwin Kerk > Web Developer > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php