Question
DSN connection string problems
my hosting service provided me with this connection string.
DRIVER={MySQL ODBC 3.51 Driver}; SERVER=p50mysql231.secureserver.net; PORT=3306; DATABASE=mgidata; USER=mgidata; PASSWORD='your password'; OPTION=0;
i can fill in all the blanks but i don't know how to us it in cfquery.
as best i can guess conectstring=" ...." no longer exesitis in cf8 . Can anyone help me with how to code this string in a cfquery.
I have tried the following but get no results.
<cfset Request.DSN = "mgidata"
<cfparam name="URL.TypeID" default="1">
<cfquery name="rsProducts" datasource="#Request.DSN#">
DRIVER={MySQL ODBC 3.51 Driver}; SERVER=p50mysql231.secureserver.net; PORT=3306; DATABASE=mgidata; USER=mgidata; PASSWORD='mypassword '; OPTION=0;
SELECT ProductID, ProductName, Pcode, Price, Summary, Description, Smallimage, Online
FROM products
WHERE Online = 1
AND products.TypeID = <cfqueryparam value="#URL.TypeID#" cfsqltype="cf_sql_numeric">
ORDER BY ProductName ASC
</cfquery>
Thank you for your help
DRIVER={MySQL ODBC 3.51 Driver}; SERVER=p50mysql231.secureserver.net; PORT=3306; DATABASE=mgidata; USER=mgidata; PASSWORD='your password'; OPTION=0;
i can fill in all the blanks but i don't know how to us it in cfquery.
as best i can guess conectstring=" ...." no longer exesitis in cf8 . Can anyone help me with how to code this string in a cfquery.
I have tried the following but get no results.
<cfset Request.DSN = "mgidata"
<cfparam name="URL.TypeID" default="1">
<cfquery name="rsProducts" datasource="#Request.DSN#">
DRIVER={MySQL ODBC 3.51 Driver}; SERVER=p50mysql231.secureserver.net; PORT=3306; DATABASE=mgidata; USER=mgidata; PASSWORD='mypassword '; OPTION=0;
SELECT ProductID, ProductName, Pcode, Price, Summary, Description, Smallimage, Online
FROM products
WHERE Online = 1
AND products.TypeID = <cfqueryparam value="#URL.TypeID#" cfsqltype="cf_sql_numeric">
ORDER BY ProductName ASC
</cfquery>
Thank you for your help
