|
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]
|