I’m writing a PHP script which inserts rows into a SQLite database. The code looks something like
$insertStmt = $db->prepare('INSERT INTO directions VALUES (?, ?, ?)');
$insertStmt->execute(array($column1, $column2, $column3));
Column 1 contains a non-unique value, but for some reason I only get one row per unique value of column 1. So for example, if I were creating a table of people and what country they live in, and country is column 1, I am only getting one row per country rather than one row per person. Can anyone think of why this would be? I didn’t explicitly set a primary key, but maybe it was automatically assigned to column 1?
My sneaky SQLite software automatically set the first column to PRIMARY KEY.