Im working on a table that has 4 columns and the first one is an auto incrementing integer called id.
If im going to insert into this table using mysqli prepared statements I keep having trouble inserting a query that works. Using PHPmyAdmin It tells me to give it NULL. Ive tried this:
$query = "INSERT INTO tbl (id, col2, col3, col4) VALUES ('NULL', ?, ?, ?)";
$stmt -> bind_param("ssi", $col2, $col3, $col4)
and this
$query = "INSERT INTO tbl (id, col2, col3, col4) VALUES (NULL, ?, ?, ?)";
$stmt -> bind_param("ssi", $col2, $col3, $col4)
and only give bind_param 3 arguments (the last 3). Neither of those work. I also tried this:
$null = NULL;
$query = "INSERT INTO tbl (id, col2, col3, col4) VALUES (?, ?, ?, ?)";
$stmt -> bind_param("issi", $null, $col2, $col3, $col4);
None of these work. Is there a standardized way of inserting into this type of table?