House of Fusion
Search over 2,500 ColdFusion resources here
  
Home of the ColdFusion Community

Mailing Lists
Home /  Groups /  ColdFusion Talk (CF-Talk)

ColdFusion and mySQL

  << Previous Post |  RSS |  Tree View |  Sort Latest First |  Subscribe to this Group Next >> 

CF and mySQL

There is something wrong with my syntax. I just converted my Access database FlashGuy 12/03/2002 10:21 AM
Do you actually get the "?" inserted into the DB or does the Query debug Mike Townend 12/03/2002 10:33 AM
do any of the variables contain "\" Robertson-Ravo, Neil (RX) 12/03/2002 10:37 AM
hehe..... Get rid of the single quotes around your <cfqueryparam> it Mark A. Kruger - CFG 12/03/2002 10:46 AM
I actually get the "?" inserted into my two fields in the database. FlashGuy 12/03/2002 10:49 AM
Yes, the "FORM.destination" but thats the reason for the "<cfqueryparam FlashGuy 12/03/2002 10:50 AM
I did and I still get "?" inserted in the database? FlashGuy 12/03/2002 10:53 AM
Hi, Eric Guesdon 12/03/2002 10:56 AM
doesn't mySQL use \ for something internally? I had a problem with it ages Robertson-Ravo, Neil (RX) 12/03/2002 11:00 AM
Hmmmm..... Mark A. Kruger - CFG 12/03/2002 11:04 AM
Quoting FlashGuy <flashmx@rogers.com>: Jochem van Dieten 12/03/2002 11:10 AM
Yes I'm sure. FlashGuy 12/03/2002 11:13 AM
Correct. Thats the reason for the <cfqueryparam...> FlashGuy 12/03/2002 11:14 AM
On Tue,  3 Dec 2002 17:00:38 +0100, Jochem van Dieten wrote: FlashGuy 12/03/2002 11:18 AM
Got it. FlashGuy 12/03/2002 11:22 AM
I don't use mySQL but I remember someone saying \ is an escape character... S. Isaac Dealey 12/03/2002 11:26 AM
erm, what version of  mySQL? Robertson-Ravo, Neil (RX) 12/03/2002 11:29 AM
Shoot - well, I'm out of ideas <g>. Mark A. Kruger - CFG 12/03/2002 11:32 AM
what was it? Robertson-Ravo, Neil (RX) 12/03/2002 11:39 AM
FlashGuy wrote: Jochem van Dieten 12/03/2002 04:05 PM

12/03/2002 10:21 AM
Author: FlashGuy Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:19439#98439 There is something wrong with my syntax. I just converted my Access database over to mySQL. Whats wrong with the <cfqueryparam>? I get "?" question marks inserted into the database when I execute the updated code. Before: --------- <cfquery name="update_alias" DATASOURCE="Alias"> Insert into alias (env_var, destination) VALUES ('#FORM.env_var#', '#FORM.destination#') </cfquery> After: ------- <cfquery name="update_alias" DATASOURCE="Alias"> Insert into alias (env_var, destination) VALUES ('<cfqueryparam value="#FORM.env_var#" cfsqltype="CF_SQL_LONGVARCHAR">', '<cfqueryparam value="#FORM.destination#" cfsqltype="CF_SQL_LONGVARCHAR">') </cfquery> --------------------------------------------------- Colonel Nathan R. Jessop Commanding Officer Marine Ground Forces Guatanamo Bay, Cuba ---------------------------------------------------
12/03/2002 10:33 AM
Author: Mike Townend Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:19439#98445 Do you actually get the "?" inserted into the DB or does the Query debug show a ?.... ? There is something wrong with my syntax. I just converted my Access database over to mySQL. Whats wrong with the <cfqueryparam>? I get "?" question marks inserted into the database when I execute the updated code. Before: --------- <cfquery name="update_alias" DATASOURCE="Alias"> Insert into alias (env_var, destination) VALUES ('#FORM.env_var#', '#FORM.destination#') </cfquery> After: ------- <cfquery name="update_alias" DATASOURCE="Alias"> Insert into alias (env_var, destination) VALUES ('<cfqueryparam value="#FORM.env_var#" cfsqltype="CF_SQL_LONGVARCHAR">', '<cfqueryparam value="#FORM.destination#" cfsqltype="CF_SQL_LONGVARCHAR">') </cfquery> --------------------------------------------------- Colonel Nathan R. Jessop Commanding Officer Marine Ground Forces Guatanamo Bay, Cuba ---------------------------------------------------
12/03/2002 10:37 AM
Author: Robertson-Ravo, Neil (RX) Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:19439#98448 do any of the variables contain "\" There is something wrong with my syntax. I just converted my Access database over to mySQL. Whats wrong with the <cfqueryparam>? I get "?" question marks inserted into the database when I execute the updated code. Before: --------- <cfquery name="update_alias" DATASOURCE="Alias"> Insert into alias (env_var, destination) VALUES ('#FORM.env_var#', '#FORM.destination#') </cfquery> After: ------- <cfquery name="update_alias" DATASOURCE="Alias"> Insert into alias (env_var, destination) VALUES ('<cfqueryparam value="#FORM.env_var#" cfsqltype="CF_SQL_LONGVARCHAR">', '<cfqueryparam value="#FORM.destination#" cfsqltype="CF_SQL_LONGVARCHAR">') </cfquery> --------------------------------------------------- Colonel Nathan R. Jessop Commanding Officer Marine Ground Forces Guatanamo Bay, Cuba ---------------------------------------------------
12/03/2002 10:46 AM
Author: Mark A. Kruger - CFG Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:19439#98454 hehe..... Get rid of the single quotes around your <cfqueryparam> it should NOT be: ('<cfqueryparam value="#FORM.env_var#" cfsqltype="CF_SQL_LONGVARCHAR">', it SHOULD be (<cfqueryparam value="#FORM.env_var#" cfsqltype="CF_SQL_LONGVARCHAR">, You are inserting the placeholder. -Mark There is something wrong with my syntax. I just converted my Access database over to mySQL. Whats wrong with the <cfqueryparam>? I get "?" question marks inserted into the database when I execute the updated code. Before: --------- <cfquery name="update_alias" DATASOURCE="Alias"> Insert into alias (env_var, destination) VALUES ('#FORM.env_var#', '#FORM.destination#') </cfquery> After: ------- <cfquery name="update_alias" DATASOURCE="Alias"> Insert into alias (env_var, destination) VALUES ('<cfqueryparam value="#FORM.env_var#" cfsqltype="CF_SQL_LONGVARCHAR">', '<cfqueryparam value="#FORM.destination#" cfsqltype="CF_SQL_LONGVARCHAR">') </cfquery> --------------------------------------------------- Colonel Nathan R. Jessop Commanding Officer Marine Ground Forces Guatanamo Bay, Cuba ---------------------------------------------------
12/03/2002 10:49 AM
Author: FlashGuy Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:19439#98457 I actually get the "?" inserted into my two fields in the database. ----- Excess quoted text cut - see Original Post for more -----
12/03/2002 10:50 AM
Author: FlashGuy Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:19439#98458 Yes, the "FORM.destination" but thats the reason for the "<cfqueryparam value="#FORM.destination#" cfsqltype="CF_SQL_LONGVARCHAR">" Yet the "?" are being inserted. ----- Excess quoted text cut - see Original Post for more -----
12/03/2002 10:53 AM
Author: FlashGuy Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:19439#98460 I did and I still get "?" inserted in the database? <cfquery name="update_alias" DATASOURCE="Alias"> UPDATE alias SET env_var = <cfqueryparam value="#FORM.env_var#" cfsqltype="CF_SQL_LONGVARCHAR">, destination = <cfqueryparam value="#FORM.destination#" cfsqltype="CF_SQL_LONGVARCHAR"> WHERE alias_ID = #FORM.alias_ID# </cfquery> ----- Excess quoted text cut - see Original Post for more -----
12/03/2002 10:56 AM
Author: Eric Guesdon Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:19439#98462 Hi, I don't know how your access database was built but it seams your problem come from encoding. Access is Unicode compatible and MySql doesn't I use the same couple of techno - Flash - CFMX - MySql I have had to insert each special with urlFncodedFormat function Best regards Eric -----Message d'origine----- De : Robertson-Ravo, Neil (RX) [mailto:Neil.Robertson-Ravo@csd.reedexpo.com] Envoyé : mardi 3 décembre 2002 16:26 À : CF-Talk Objet : RE: CF and mySQL do any of the variables contain "\" There is something wrong with my syntax. I just converted my Access database over to mySQL. Whats wrong with the <cfqueryparam>? I get "?" question marks inserted into the database when I execute the updated code. Before: --------- <cfquery name="update_alias" DATASOURCE="Alias"> Insert into alias (env_var, destination) VALUES ('#FORM.env_var#', '#FORM.destination#') </cfquery> After: ------- <cfquery name="update_alias" DATASOURCE="Alias"> Insert into alias (env_var, destination) VALUES ('<cfqueryparam value="#FORM.env_var#" cfsqltype="CF_SQL_LONGVARCHAR">', '<cfqueryparam value="#FORM.destination#" cfsqltype="CF_SQL_LONGVARCHAR">') </cfquery> --------------------------------------------------- Colonel Nathan R. Jessop Commanding Officer Marine Ground Forces Guatanamo Bay, Cuba ---------------------------------------------------
12/03/2002 11:00 AM
Author: Robertson-Ravo, Neil (RX) Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:19439#98464 doesn't mySQL use \ for something internally? I had a problem with it ages back.... can't remember what it was though! Yes, the "FORM.destination" but thats the reason for the "<cfqueryparam value="#FORM.destination#" cfsqltype="CF_SQL_LONGVARCHAR">" Yet the "?" are being inserted. > do any of the variables contain "\" > There is something wrong with my syntax. I just converted my Access database ----- Excess quoted text cut - see Original Post for more ----- cfsqltype="CF_SQL_LONGVARCHAR">') ----- Excess quoted text cut - see Original Post for more -----
12/03/2002 11:04 AM
Author: Mark A. Kruger - CFG Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:19439#98466 Hmmmm..... Are you sure. Delete them all manually and try again. I did and I still get "?" inserted in the database? <cfquery name="update_alias" DATASOURCE="Alias"> UPDATE alias SET env_var = <cfqueryparam value="#FORM.env_var#" cfsqltype="CF_SQL_LONGVARCHAR">, destination = <cfqueryparam value="#FORM.destination#" cfsqltype="CF_SQL_LONGVARCHAR"> WHERE alias_ID = #FORM.alias_ID# </cfquery> > hehe..... Get rid of the single quotes around your <cfqueryparam> it should ----- Excess quoted text cut - see Original Post for more ----- database ----- Excess quoted text cut - see Original Post for more ----- cfsqltype="CF_SQL_LONGVARCHAR">') ----- Excess quoted text cut - see Original Post for more -----
12/03/2002 11:10 AM
Author: Jochem van Dieten Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:19439#98471 Quoting FlashGuy <flashmx@rogers.com>: ----- Excess quoted text cut - see Original Post for more ----- Can you show us the query debug output? And you really should convert that last pass through variable into a cfqueryparam too. Jochem
12/03/2002 11:13 AM
Author: FlashGuy Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:19439#98474 Yes I'm sure. I removed the "env_var = <cfqueryparam value="#FORM.env_var#" cfsqltype="CF_SQL_LONGVARCHAR">" and put it back the way I had it before to "env_var = '#FORM.env_var#'. Now this field gets inserted properly but the "destination = <cfqueryparam value="#FORM.destination#" cfsqltype="CF_SQL_LONGVARCHAR">" gets inserted as a "?" It has to be the syntax of the SQL statement? I'm using the <cfqueryparam on another database and it works great. ----- Excess quoted text cut - see Original Post for more -----
12/03/2002 11:14 AM
Author: FlashGuy Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:19439#98475 Correct. Thats the reason for the <cfqueryparam...> ----- Excess quoted text cut - see Original Post for more -----
12/03/2002 11:18 AM
Author: FlashGuy Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:19439#98477 On Tue,  3 Dec 2002 17:00:38 +0100, Jochem van Dieten wrote: ----- Excess quoted text cut - see Original Post for more ----- Even if the variable won't ever contain a "\" like the destination field? > > Jochem
12/03/2002 11:22 AM
Author: FlashGuy Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:19439#98479 Got it. Thanks ----- Excess quoted text cut - see Original Post for more -----
12/03/2002 11:26 AM
Author: S. Isaac Dealey Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:19439#98483 I don't use mySQL but I remember someone saying \ is an escape character... <cfqeuryparam> will allow you to put \ in a varchar field in mySQL however. It's in one of the threads in the cf-talk archive. ----- Excess quoted text cut - see Original Post for more -----
12/03/2002 11:29 AM
Author: Robertson-Ravo, Neil (RX) Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:19439#98485 erm, what version of  mySQL? Correct. Thats the reason for the <cfqueryparam...> ----- Excess quoted text cut - see Original Post for more -----
12/03/2002 11:32 AM
Author: Mark A. Kruger - CFG Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:19439#98486 Shoot - well, I'm out of ideas <g>. Yes I'm sure. I removed the "env_var = <cfqueryparam value="#FORM.env_var#" cfsqltype="CF_SQL_LONGVARCHAR">" and put it back the way I had it before to "env_var = '#FORM.env_var#'. Now this field gets inserted properly but the "destination = <cfqueryparam value="#FORM.destination#" cfsqltype="CF_SQL_LONGVARCHAR">" gets inserted as a "?" It has to be the syntax of the SQL statement? I'm using the <cfqueryparam on another database and it works great. ----- Excess quoted text cut - see Original Post for more -----
12/03/2002 11:39 AM
Author: Robertson-Ravo, Neil (RX) Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:19439#98487 what was it? Got it. Thanks ----- Excess quoted text cut - see Original Post for more ----- ages ----- Excess quoted text cut - see Original Post for more ----- cfsqltype="CF_SQL_LONGVARCHAR">', ----- Excess quoted text cut - see Original Post for more -----
12/03/2002 04:05 PM
Author: Jochem van Dieten Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:19439#98538 FlashGuy wrote: ----- Excess quoted text cut - see Original Post for more ----- Yes, always (see list archives and MM knowledgebase for the reasons). And if you still have the problem, send the debug output. Jochem
<< Previous Thread Today's Threads Next Thread >>

Search cf-talk

May 18, 2013

<<   <   Today   >   >>
Su Mo Tu We Th Fr Sa
       1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31   

Designer, Developer and mobile workflow conference