Results 1 to 3 of 3
Thread: SQL CREATE TABLE ISSUES ?!?
Dec 6, 2000, 01:08 #1
- Join Date
- Jul 2000
- Sydney, Australia
- 0 Post(s)
- 0 Thread(s)
I've been trying to create a table in MS Access with PHP/Apache using ODBC.
I can create a simple table, but the problem is when I add the PRIMARY KEY attribute to the ir_no field it returns an error.
The SQL code is as follows:
$sql = "CREATE TABLE Incident (" . "ir_no INT PRIMARY KEY, " . "vendor_incident_no INT, " . "date_raised DATE NOT NULL, " . "short_desc TEXT, " . "review_comments TEXT, " . "raised_by INT NOT NULL, " . "severity INT NOT NULL, " . "application INT NOT NULL, " . "priority INT NOT NULL, " . "status INT NOT NULL " . ")"; $cur = odbc_exec( $cnx, $sql );
Also, I want the ir_no field to be auto incremented. I tried adding the AUTO_INCREMENT attribute to the ir_no field, but again it didn't like the SQL statement.
What am I doing wrong???
Thanks, and merry Christmas!