Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SQL INSERT

Status
Not open for further replies.

jonnyshaw

IS-IT--Management
Mar 15, 2006
3
GB
im very confused with my sql statement, Can anyone see anything wrong with it??

<CFQUERY datasource="#Application.datasource#" name="AddCartItem">

INSERT INTO tblCartItems (CartIDPK, ItemIDPK, Quantity, Colour, Size)
VALUES ('#Session.CartID#','#Form.ItemID#','1','#Form.Colour#,'#Form.Size#')
</cfquery>

Thanks For Any Help
 
At least, unbalanced single quotes.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
...,'#Form.Colour#[!]'[/!],'#...

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
i have changed that but it still comes up with syntax error
 
SIZE is a reserved word in ANSI/ISO SQL.

You'll have to delimit that column name (i.e. "Size".)
 
the ID columns as well as Quantity are probably numeric, in which case you should not be trying to insert strings into them -- remove the quotes

r937.com | rudy.ca
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top