I work with SQLite3 in PHP. I fulfill request

INSERT INTO chat(uid, message) VALUES (123456789,'message'); 

But nothing is added, although everything works fine with other tables. Here are the columns in this table: id - INTEGER PRIMARY KEY. uid - INTEGER, message - TEXT

  • How exactly do you execute the query and track errors? - teran
  • I execute queries like this $ db-> query ('INSERT INTO db VALUES (111, "111")'); and errors so if (! $ db-> query ()) {echo 'error';} - DcoartB

1 answer 1

there is a suspicion that in the absence of an AUTOINCREMENT ID field, try re-creating the table

 create table chat ( id INTEGER PRIMARY KEY AUTOINCREMENT, uid INTEGER, message TEXT ) ;