sfgn
sfgn

Reputation: 11

`id` int(10) NOT NULL auto_increment

This field type:

`id` int(10) NOT NULL auto_increment

...accepts does not accept value ('') on one server/database while another server/database accepts it.

Is there some kind of inconsistency somewhere in the setup? I tried different server versions - 5.1.52, 5.1.57, 5.5. How to make them consistent?

Upvotes: 1

Views: 541

Answers (1)

Dipesh KC
Dipesh KC

Reputation: 3297

if your field is of autoincrement type then you should simply skip it.

for example you need to insert a comment where id is 'autoincrement' field then:

$add="INSERT INTO comments (comment, author_id, article_id) VALUES ('".$comment."',".$authorID.",".$articleID." )";

$result=mysql_query($add)

...

Upvotes: 1

Related Questions