Re: What's wrong with this query?
| From: | Nitin Mehta | Date: | Thu, 26 Feb 2004 12:26:29 +0000 |
| Subject: | Re: What's wrong with this query? | ||
| References: | 1 2 3 4 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-33149@lists.php.net to get a copy of this message | ||
exactly, i'm using it for more than a year
----- Original Message -----
From: "Erwin Kerk" <erwin@infofeed.nl>
To: <nfzgrld@axelis.com>; "PHP DB" <php-db@lists.php.net>
Sent: Thursday, February 26, 2004 5:36 PM
Subject: Re: [PHP-DB] 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
>