proper way of inserting data with id as auto-increment in mysqli

后端 未结 3 927
予麋鹿
予麋鹿 2020-12-21 06:20

can someone please verify the proper way of inserting data using MYSQLI?

i need to insert comment data into the table with ID set as auto-increment. do i just leave

3条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-21 07:14

    Yes, leave it blank and MySQL gives it a value.

    $query = "INSERT INTO comments (data_column_name) VALUES ('$comment')";
    

提交回复
热议问题