You are here: Re: ok problems entering data into database « PHP Programming Language « IT news, forums, messages
Re: ok problems entering data into database

Posted by Bart op de grote markt on 11/23/06 10:29

so many sites so little time schreef:

> yeah i think im gonna insert null i just wat to be able to post text so
> that it appears like the content of a web page and then can be edited
> but when ive been going and trying to edit it say i say home_id 1 or
> what ever and then i tell it to get from row 1 it returns a error
> which i tell it to if it didnt get an id
>

> > >// Define the query.
> > >$query = 'CREATE TABLE blog_entries (
> > > blog_id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
> > > title VARCHAR(100) NOT NULL,
> > > entry TEXT NOT NULL,
> > > date_entered DATETIME NOT NULL
> > > )';

Here you write something like this:

INSERT INTO A_TABLE (Column_1, Column_2, Column_3,
Column_4) VALUES (Value_2, Value_3, Column_4)

as mentioned above it should be like:

INSERT INTO A_TABLE (Column_1, Column_2, Column_3,
Column_4) VALUES (Value_1,Value_2, Value_3, Column_4)

And since Column_1 is an AUTO_INCREMENT-id, u don't need to include it
in your insert at all.

So u can use this:

INSERT INTO A_TABLE (Column_2, Column_3,
Column_4) VALUES (Value_2, Value_3, Column_4)

Greets,

Bart

 

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

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