|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stay one step ahead of the competition. Evaluate and give feedback
on some of the hottest web development tools on the market today.
Make your opinion heard! Click
Here
|
|
#1
|
|||
|
|||
|
can anyone see anything wrong with this insert into code?
<cfquery name="AddCar" datasource="hj">
INSERT INTO stock (makeID,modelID,variant,bodyStyleID,year,reg,miles,owners,colour,condition,price,description,powerSt eering,airCon,centralLock,elecWindows,alloys,alarm,warranty,branchID,reservedID,carOfWeek,AuctionCar ) VALUES ('#Form.makeid#','#Form.modelid#','#Form.variant#','#Form.bodystyleid#','#Form.year#','#Form.reg#',' #Form.miles#','#Form.owners#','#Form.colour#','#Form.condition#','#Form.price#','#Form.description#' ,'#Form.powersteering#','#Form.aircon#','#Form.centrallock#','#Form.elecwindows#','#Form.alloys#','# Form.alarm#','#Form.warranty#','#Form.branchid#','#Form.reservedid#','#Form.caroftheweek#','#Form.au ctioncar#') </cfquery> the field names and the form names are all correct, but there seems to be some kind of error (I get page can't be displayed), can anyone see anything wrong with this code? |
|
#2
|
|||
|
|||
|
Confirm that all your database fields are strings. You're inserting them all with single quotes which means that you think they are all strings.
__________________
Ask if you have a question, but also help answer questions that you have knowledge of! Thanks, Brian. How to Post a Question in the Forums |
|
#3
|
|||
|
|||
|
This powerSt eering, is suposed to have a space in it?
|
|
#4
|
|||
|
|||
|
Quote:
hey man, thanks, i didnt think of that. No, not all my fields are strings...so what syntax would you use for numbers, memo, yes/no etc?? thanks again |
|
#5
|
|||
|
|||
|
I'd start by taking away the single quotes around the fields that are not strings.
|
|
#6
|
|||
|
|||
|
still giving me hassle, this is the table structure:
<cfquery name="AddCar" datasource="hj"> INSERT INTO stock (makeID,modelID,variant,bodyStyleID,year,reg,miles,owners,colour,condition,price,description,powerSt eering,airCon,centralLock,elecWindows,alloys,alarm,warranty,branchID,reservedID,carOfWeek,AuctionCar ) VALUES ('#Form.makeid#','#Form.modelid#','#Form.variant#','#Form.bodystyleid#','#Form.year#','#Form.reg#',' #Form.miles#','#Form.owners#','#Form.colour#','#Form.condition#','#Form.price#','#Form.description#' ,'#Form.powersteering#','#Form.aircon#','#Form.centrallock#','#Form.elecwindows#','#Form.alloys#','# Form.alarm#','#Form.warranty#','#Form.branchid#','#Form.reservedid#','#Form.caroftheweek#','#Form.au ctioncar#') </cfquery> it should work, very odd |
|
#7
|
|||
|
|||
|
Um, I don't see that you actually did anything, that SQL looks exactly the same as the first code block you posted. Like I said, try taking away the single quotes from the fields that are not string fields, and that means the yes/no fields. Also verify that you are passing valid values in those fields. The problem is absolutely with the data types so I can only tell you to do use trial and error, or start with only one field and then keep adding fields until you find the one(s) causing the problem.
|
|
#8
|
|||
|
|||
|
thanks man, i'll try that. I actually tried removing the ' for yes/no boxes earlier and still had the same problem, so i reckon it must be because description is a memo or something, but i shud have it soon, thanks
|
|
#9
|
|||
|
|||
|
Memo should still be handled like a string, so I'm still thinking it may be the values you are passing into the yes/no field. What are you passing? I would try passing a 1 or a 0.
|
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > ColdFusion Development > can anyone see anything wrong with this insert into code? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|