Ciao a tutti, nella mia applicazione php sto utilizzando SQLITE.
Ho definito una tabella:
Codice PHP:
create table patient(
id_patient integer primarykey AUTOINCREMENT,
id_doc integer,
patient_code integer,
age integer,
gender varchar(1),
day_op varchar(2),
month_op varchar(2),
year_op varchar(4),
day_fu varchar(2),
month_fu varchar(2),
year_fu varchar(4),
status varchar(5)
);
e successivamente effettuo la seguente query:
Codice PHP:
INSERT INTO patient(age) values(20);
SUbito dopo , creo la seguente query:
Codice PHP:
$result = sqlite_query($dbconn, "SELECT * FROM patient");
if (sqlite_num_rows($result)==0)
return -1;
$result = sqlite_fetch_all($result, SQLITE_ASSOC);
foreach ($result as $entry) {
echo 'id_patient: ' . $entry['id_patient'] . "
";
}
Ma non mi visualizza l'id_patient ....
Non dovrebbe essere settato automaticamente dopo l'INSERT ?????
grazie