Stumped with NOT NULL AUTO_INCREMENT

Stumped with NOT NULL AUTO_INCREMENT

I've almost made it through my webpage without asking questions, but this problem has me stumped.

I am trying to create a new table with the ID column being NOT NULL AUTO_INCREMENT.

The table will create if I do not have NOT NULL AUTO_INCREMENT, but it WILL NOT create if I add those commands.

Here is my code:

mysql_query(
            "CREATE TABLE fb_$user_id 
                (
                 id MEDIUMINT NOT NULL AUTO_INCREMENT,
                 user_id INT(11), 
                 courseid INT(10), 
                 score INT(13), 
                 date TEXT
                )"
            );

Hopefully this code shows up correctly. I did follow the 'how to post code block correctly' instructions.

Thanks for your help

View Answers









Related Tutorials/Questions & Answers:
query regarding auto increment primary key
query regarding auto increment primary key  i want to use s1,s2.... as my auto increment primary key.cant i do this in mysql
How to auto increment primary key in mysql...
How to auto increment primary key in mysql...  How to auto increment primary key in mysql... and one more thing i need to get auto increment value in front end each time for inserting the value[JSP
Advertisements
how to declare a auto increment in sql - SQL
how to declare a auto increment in sql  Dear sir, How to declare a auto increment insql? i used a identity but it is nt working in sql,so... table form will get open. Click the checkbox option of Auto_Incrt for the field 'id
SQL Auto increment Primary Key
SQL Auto increment Primary Key       SQL Auto increment Primary Key is used to allow a unique... from 'SQL Auto increment Primary Key'. To understand this example we use a query
MySQL Auto_Increment
MEDIUMINT NOT NULL AUTO_INCREMENT, name CHAR(30) NOT NULL, PRIMARY...MySQL Auto_Increment This example illustrates how to define AUTO_INCREMENT of a field. The AUTO_INCREMENT attribute can be used to generate a unique
MySQL Auto_Increment
animals ( id MEDIUMINT NOT NULL AUTO_INCREMENT, name CHAR(30... MySQL Auto_Increment       MySQL Auto_Increment is used to generate a unique number when a new
Auto Increment and Decrement
Auto Increment and Decrement   ... of this variable. Now we are applying the prefix increment operator and display the value on the console and then applying the postfix increment operator
JDBC: MYSQL Auto_Increment key Example
TABLE department(id int NOT NULL AUTO_INCREMENT,name varchar(30),PRIMARY KEY(id...(11) (NULL) NO PRI (NULL) auto_increment select...JDBC: MYSQL Auto_Increment key Example In this tutorial we are setting one
autoincerament
autoincerament  Hi, i have one textfield in html form and i want to set it as auto increment on submit using php query
deleting all records from a table in mysql
increment then if you add new record it will next form the last max auto increment id. If you want to reset the auto increment column then you can truncate... from EMPLOYEE table and also reset auto increment field to start from 1. Thanks
jstl - Java Beginners
jstl   hi, I need sample code for auto increment the serial number fro mthe table using jstl. Please send the sample code urgently needed. Thanks, Valarmathi
deleting all records from a table in mysql
increment then if you add new record it will next form the last max auto increment id. If you want to reset the auto increment column then you can truncate... from EMPLOYEE table and also reset auto increment field to start from 1. Thanks
BACKEND - JSP-Interview Questions
any sql specific to a particular database. For example in MySQL there is auto-increment property for the int primary key. But in in Oracle there is no auto-increment like thing. Instead it supports the Sequences. So, there is small
how to use foreign key in java
how to use foreign key in java  I have two tables in my MySQL database, which were created like this: CREATE TABLE table1 ( id int auto_increment, first name varchar(10), primary key(id) ) CREATE TABLE table2 ( id_fk int, last
MySQL Bitwise Operator
(id INT(10) AUTO_INCREMENT, number INT(10), PRIMARY KEY(id)); Query
request to help
of the employee object with the employee id (auto -increment, assigning 1 to first
developing a system using php n mysql
,handp.num,date of report,aset num,auto increment of report data.lastly,the system need
Dynamic Dropdown Menu
_list (c_id int auto_increment, c_name varchar(20), primary key(c_id));ADS... as auto_increment, value starts from 1 and automatically increases by 1 with each
SHOWING ERROR CODE 1064 WHILE TRYING TO EXECUTE PROCEDURE
AUTO_INCREMENT=20; INSERT INTO FEE_CLASS_CATEGORY_NAME(CLASS_CATEGORY_ID
Php Sql Script
;(id INT NOT NULL AUTO_INCREMENT,    
MySQL 8 Features
the innodb_deadlock_detect variable value.ADS_TO_REPLACE_5 11. Auto-increment counter value persist across server restart If you have highly transaction application with lots of insert this feature will help you. The value of Auto
PHP SQL Script
;NOT NULL AUTO_INCREMENT,  name VARCHAR(250), reset
SimpleJdbcInsert, Retrieving auto-generated keys
and also it must be set for auto increment in database. Example : The main...SimpleJdbcInsert, Retrieving auto-generated keys The auto-generated keys can... of the auto generated key column can be specified by passing it's name to method
Servlet Response Send Redirect - JSP-Servlet
key(i have kept a non-auto increment), the user clicks ok on the message
Writing a Program to calculate Circumference of planets reading from a file and writing to new file.
stumped when it comes to reading the file and writing to a new file. My code
inserting into mysql database with uid to be primary key and autoincrement
. In the database table, set the uid as the primary key and auto-increment. Then, whenever... from a jsp form where there will be a uid which will be auto incremented each

Ads