Apr-01-2024, 08:56 AM
(This post was last modified: Apr-01-2024, 08:56 AM by Pedroski55.)
Maybe the CREATE command has a problem?
Instead of AUTOINCREMENT try AUTO_INCREMENT? Otherwise AUTOINCREMENT may be interpreted as a column name.
This works in my MySQL database:
Instead of AUTOINCREMENT try AUTO_INCREMENT? Otherwise AUTOINCREMENT may be interpreted as a column name.
Quote:CREATE TABLE IF NOT EXISTS patients (
id INTEGER PRIMARY KEY AUTO_INCREMENT,
reference_no TEXT,
issued_date TEXT,
appointment_date TEXT,
patient_id TEXT,
patient_name TEXT,
date_of_birth TEXT,
patient_address TEXT,
nhs_number TEXT,
name_of_tablets TEXT,
no_of_tablets TEXT,
dose TEXT,
use_medication TEXT,
doctor_name TEXT
)
This works in my MySQL database:
Quote:INSERT INTO patients (
reference_no, issued_date, appointment_date, patient_id, patient_name, date_of_birth,
patient_address, nhs_number, name_of_tablets, no_of_tablets, dose, use_medication, doctor_name
) VALUES ('A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M')
SELECTid
,use_medication
,doctor_name
FROMpatients
WHERE 1