Home Answers Viewqa PHP Stumped with NOT NULL AUTO_INCREMENT

 
 


steve
Stumped with NOT NULL AUTO_INCREMENT
0 Answer(s)      a year ago
Posted in : PHP

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 Pages:
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
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..._id" to be an auto-increment primary key field in the table "employee
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 and display
autoincerament
autoincerament  Hi, i have one textfield in html form and i want to set it as auto increment on submit using php query
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
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
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
Dynamic Dropdown Menu
auto_increment, c_name varchar(20), primary key(c_id)); After that insert few...: Whenever we select any field as auto_increment, value starts from 1
SHOWING ERROR CODE 1064 WHILE TRYING TO EXECUTE PROCEDURE
AUTO_INCREMENT=20; INSERT INTO FEE_CLASS_CATEGORY_NAME(CLASS_CATEGORY_ID
Php Sql Script
;AUTO_INCREMENT,     name VARCHAR(250), reset
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
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
PHP SQL Script
;TABLE emp_counter (id INT NOT NULL AUTO_INCREMENT
Servlet Response Send Redirect - JSP-Servlet
key(i have kept a non-auto increment), the user clicks ok on the message
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
Setting focus to second component of modal dialog - tutorial
got stumped by a seemingly simple problem. I was trying to write a login dialog
Hooking into the shutdown call - tutorial
on a modal dialog. This seemingly simple problem had me quite stumped, but luckily

Ask Questions?

If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.

Ask your questions, our development team will try to give answers to your questions.