abanana
08-21-2006, 09:27 PM
i just don't understand why i cannot insert some form data into MySQL INNODB table, plz help!
insert statement$q = "INSERT INTO books VALUES ('$title', '$author')";
return mysql_query($q, $this->connection);
first tableCREATE TABLE books (
title varchar(90),
author varchar(90)
) TYPE=INNODB;
no problem at all insert form data into this table, but when i change the table to CREATE TABLE books (
book_id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
title varchar(90),
author varchar(90)
) TYPE=INNODB;
i cant insert nothing, very strange!
there's no foreign key involved, just a single table. what's the problem?
thx very much
insert statement$q = "INSERT INTO books VALUES ('$title', '$author')";
return mysql_query($q, $this->connection);
first tableCREATE TABLE books (
title varchar(90),
author varchar(90)
) TYPE=INNODB;
no problem at all insert form data into this table, but when i change the table to CREATE TABLE books (
book_id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
title varchar(90),
author varchar(90)
) TYPE=INNODB;
i cant insert nothing, very strange!
there's no foreign key involved, just a single table. what's the problem?
thx very much