ColdFusion Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreColdFusion Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
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  
Old March 1st, 2005, 01:47 PM
jpixel jpixel is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2005
Posts: 47 jpixel User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 50 m 41 sec
Reputation Power: 4
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?

Reply With Quote
  #2  
Old March 1st, 2005, 01:54 PM
kiteless kiteless is offline
Moderator
Dev Shed Expert (3500 - 3999 posts)
 
Join Date: Jun 2002
Location: Raleigh, NC
Posts: 3,611 kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 1 Week 4 Days 9 h 10 m 21 sec
Reputation Power: 53
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

Reply With Quote
  #3  
Old March 1st, 2005, 02:34 PM
VelvettFogg VelvettFogg is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2004
Posts: 34 VelvettFogg User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 13 m 46 sec
Reputation Power: 4
This powerSt eering, is suposed to have a space in it?

Reply With Quote
  #4  
Old March 1st, 2005, 03:11 PM
jpixel jpixel is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2005
Posts: 47 jpixel User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 50 m 41 sec
Reputation Power: 4
Quote:
Originally Posted by kiteless
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.


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

Reply With Quote
  #5  
Old March 1st, 2005, 03:46 PM
kiteless kiteless is offline
Moderator
Dev Shed Expert (3500 - 3999 posts)
 
Join Date: Jun 2002
Location: Raleigh, NC
Posts: 3,611 kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 1 Week 4 Days 9 h 10 m 21 sec
Reputation Power: 53
I'd start by taking away the single quotes around the fields that are not strings.

Reply With Quote
  #6  
Old March 1st, 2005, 06:05 PM
jpixel jpixel is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2005
Posts: 47 jpixel User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 50 m 41 sec
Reputation Power: 4
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

Reply With Quote
  #7  
Old March 1st, 2005, 06:20 PM
kiteless kiteless is offline
Moderator
Dev Shed Expert (3500 - 3999 posts)
 
Join Date: Jun 2002
Location: Raleigh, NC
Posts: 3,611 kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 1 Week 4 Days 9 h 10 m 21 sec
Reputation Power: 53
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.

Reply With Quote
  #8  
Old March 1st, 2005, 07:04 PM
jpixel jpixel is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2005
Posts: 47 jpixel User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 50 m 41 sec
Reputation Power: 4
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

Reply With Quote
  #9  
Old March 1st, 2005, 07:31 PM
kiteless kiteless is offline
Moderator
Dev Shed Expert (3500 - 3999 posts)
 
Join Date: Jun 2002
Location: Raleigh, NC
Posts: 3,611 kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 1 Week 4 Days 9 h 10 m 21 sec
Reputation Power: 53
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.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreColdFusion Development > can anyone see anything wrong with this insert into code?


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway