Jump to content

Insertion Problem With Tinyint


son
 Share

Recommended Posts

I have a query which worked well. Now I inserted a new column of type tinyint(1) (name is int) and want to insert from web page a value of 1 into column (it is to distinguish later from which form the entry came). The query does not work and it complains exactly about this bit without any more info (also when I run it in PHPMyAdmin). The query is:

INSERT INTO users (first_name, last_name, company, telephone, address1, address2, address3, town, county, postcode, country, source, other, active, int, registration_date) VALUES ('Testy', 'Tester', 'Testeron', '058784545', 'Street Name', '', '', 'City', '', 'Postcode', 'Bahamas', '', 'Testing only', '', 1, 1242318616 )

What goes wrong with my insertion of int? Without it the query works without fault...Really do not get it...Son

Link to comment
Share on other sites

"Int" is a reserved word in SQL, it's a column data type. It's like naming a column "select", or "insert". If you want to use a reserved word as a table or column name you need to enclose it in `backquotes` whenever you reference it.

Edited by justsomeguy
Link to comment
Share on other sites

"Int" is a reserved word in SQL, it's a column data type. It's like naming a column "select", or "insert". If you want to use a reserved word as a table or column name you need to enclose it in `backquotes` whenever you reference it.
Cheers,Worked now...Son
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...