|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2004-08-06 13:39 UTC] webmaster at realscripts dot de
Description:
------------
When I have an auto_increment Integer Field in my SQLite DB and I insert data the auto_increment-field gets NULL as value.
Reproduce code:
---------------
CREATE TABLE test_tbl (
ID INTEGER PRIMARY KEY,
name VARCHAR
);
sqlite_open('test.db');
sqlite_query("INSERT INTO test_tbl VALUES ('mark')");
Expected result:
----------------
ID | name
---------
1 | mark
Actual result:
--------------
ID | name
-----------
NULL | mark
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Nov 06 17:00:01 2025 UTC |
I think this is not a bug. try: sqlite_query("INSERT INTO test_tbl VALUES (NULL, 'mark')"); or sqlite_query("INSERT INTO test_tbl (name) VALUES ('mark')"); or if it is a bug, is a SQLite bug, not a PHP bug.