I have a table which only has two column:
+------------------+-------------+----------------------------+
| user_id | INT | AUTO_INCREMENT |
+------------------+-------------+----------------------------+
| user_timestamp | TIMESTAMP | DEFAULT CURRENT_TIMESTAMP |
+------------------+-------------+----------------------------+
Now I am quite confused how will I build my INSERT since all the values has default. I have this but seems not working $query = "INSERT INTO tt_users (user_id) VALUES ()";. I just want MySQL to insert a new user_id which I will retrieve using lastInsertID. Pardon, this is my first time doing this.
1 Answer