[setting value when INSERT for auto increment]
am 16.05.2011 16:49:43 von legrega
Should it be null?
INSERT INTO `friendlyCMS`.`log` (`idlog`, `imepriimek`, `clock`,
`action`, `onfile`, `filesize`) VALUES (NULL, $_COOKIE['user'],
CURRENT_TIMESTAMP, 'saved',$filename, filesize($filename));
idlog is primaryk ey auto inrement not null...
When insertin the value what should I pass it? NULL? Thanks in advance!!
-- When the sun rises I receive and when it sets I forgive ->
http://moj.skavt.net/gleskovs/
Always in Heart, Grega Leskovšek
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=3Dgcdmg-mysql-2@m.gmane.o rg
Re: [setting value when INSERT for auto increment]
am 16.05.2011 16:59:56 von Johan De Meersman
If you're asking what I think you're asking, then yes, both NULL and 0 will=
trigger an autoincrement field to put in the next value.
----- Original Message -----
> From: "Grega Leskovšek"
> To: mysql@lists.mysql.com
> Sent: Monday, 16 May, 2011 4:49:43 PM
> Subject: [setting value when INSERT for auto increment]
>
> Should it be null?
> INSERT INTO `friendlyCMS`.`log` (`idlog`, `imepriimek`, `clock`,
> `action`, `onfile`, `filesize`) VALUES (NULL, $_COOKIE['user'],
> CURRENT_TIMESTAMP, 'saved',$filename, filesize($filename));
> idlog is primaryk ey auto inrement not null...
> When insertin the value what should I pass it? NULL? Thanks in
> advance!!
--
Bier met grenadyn
Is als mosterd by den wyn
Sy die't drinkt, is eene kwezel
Hy die't drinkt, is ras een ezel
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=3Dgcdmg-mysql-2@m.gmane.o rg
Re: [setting value when INSERT for auto increment]
am 16.05.2011 22:10:04 von Basil Daoust
since your listing the columns, you could just leave off `idlog` from
the named columns and thus not also need to include the null in the
inserted values.
INSERT INTO `friendlyCMS`.`log`
(`imepriimek`, `clock`, `action`, `onfile`, `filesize`)
VALUES ($_COOKIE['user'], CURRENT_TIMESTAMP, 'saved', $filename, filesize($filename));
On 16/05/2011 9:59 AM, Johan De Meersman wrote:
> If you're asking what I think you're asking, then yes, both NULL and 0 will trigger an autoincrement field to put in the next value.
>
> ----- Original Message -----
>> From: "Grega Leskovšek"
>> To: mysql@lists.mysql.com
>> Sent: Monday, 16 May, 2011 4:49:43 PM
>> Subject: [setting value when INSERT for auto increment]
>>
>> Should it be null?
>> INSERT INTO `friendlyCMS`.`log` (`idlog`, `imepriimek`, `clock`,
>> `action`, `onfile`, `filesize`) VALUES (NULL, $_COOKIE['user'],
>> CURRENT_TIMESTAMP, 'saved',$filename, filesize($filename));
>> idlog is primaryk ey auto inrement not null...
>> When insertin the value what should I pass it? NULL? Thanks in
>> advance!!
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=gcdmg-mysql-2@m.gmane.org