You are here: Re: help me « PHP Programming Language « IT news, forums, messages
Re: help me

Posted by Geoff Muldoon on 11/15/06 01:56

cmw1985@googlemail.com says...
> I thought that
>
> print $sqlquery was the same thing, I can see the query string in one
> case it looks like this
>
> INSERT INTO tnews (id, Title, Body, Date) VALUES
> ('null','12345678ppp','ppp87654321','Wed, 15 Nov 2006 01:20:01 +0000')
>
> the reason its longer is a friend suggested i try doing the query like
> that
>
> one thing is though if i do this
>
> INSERT INTO tnews (id, Title, Body, Date) VALUES
> ('45','12345678ppp','ppp87654321','Wed, 15 Nov 2006 01:20:01 +0000')
>
> and assign 45 where previously the id was blank or null ( i tried both
> blank and null)
>
> the above works and the code is almost identical the only difference is
> that 45, so anyone got any ideas, my table id field is set as primary
> key and auto increment and not null, so why isnt it auto incrementing?

Just leave the id column out of the insert altogether, as it is
autoincrement it doesn't need to be (and shouldn't be) included in the
statement.

Geoff M

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация