Go Back   CodingForums.com > :: Server side development > Other server side languages/ issues > ColdFusion

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rating: Thread Rating: 2 votes, 5.00 average.
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 03-07-2009, 07:23 PM   PM User | #1
lse123
Regular Coder

 
Join Date: Dec 2005
Posts: 702
Thanks: 0
Thanked 0 Times in 0 Posts
lse123 is infamous around these parts
<cfquery> correct cfm <> mysql phpMyAdmin ? I use goDaddy.com hosting (php/cfml/mysql

Code:
<cfquery datasource="cf123" password="1234CF123" username="cfdbK" name="getData" >
SELECT * FROM CustomersTable
</cfquery>
is it correct if CustomersTable is a table in phpMyAdmin ? I am using www.goDaddy.com hosting (php/cfml/mysql), well ?
lse123 is offline   Reply With Quote
Old 03-08-2009, 07:28 AM   PM User | #2
Gjslick
Regular Coder

 
Join Date: Feb 2009
Location: NJ, USA
Posts: 476
Thanks: 2
Thanked 70 Times in 69 Posts
Gjslick will become famous soon enough
That would be correct if the table is in fact named CustomersTable, and you have the correct datasource name. Did you set up the datasource by the way?
Gjslick is offline   Reply With Quote
Old 03-08-2009, 09:40 AM   PM User | #3
lse123
Regular Coder

 
Join Date: Dec 2005
Posts: 702
Thanks: 0
Thanked 0 Times in 0 Posts
lse123 is infamous around these parts
<cfquery > needs any other parameter ?

phpMyAdmin may be used with PHP or CFML , Correct ?

Cfm database DSN must be setup or is the same as username ?
lse123 is offline   Reply With Quote
Old 03-08-2009, 06:14 PM   PM User | #4
Gjslick
Regular Coder

 
Join Date: Feb 2009
Location: NJ, USA
Posts: 476
Thanks: 2
Thanked 70 Times in 69 Posts
Gjslick will become famous soon enough
Actually <cfquery> only needs the name and datasource attributes. Your datasource (DSN) must be set up though. I don't know how to do that on GoDaddy (as I don't use GoDaddy), but I'm assuming it's in the GoDaddy control panel somewhere. You're just going to have to look around for it.

Note that a datasource (DSN) is not the same as just your mysql database's name. A datasource encompasses all of the information that is needed to connect and log into that mysql database. In the regular ColdFusion administrator (which I'm sure you don't have access to on GoDaddy), a datasource is set up with the database name, database type, server (usually: localhost), and the username and password that you want to log into that database with. There has to be something just like that in GoDaddy's control panel.

This would allow you to run queries just like this, if you named the datasource "myDatasource":
Code:
<cfquery name="getData" datasource="myDatasource">
  SELECT * FROM CustomersTable
</cfquery>
The username and password attributes in the <cfquery> tag are just to override the username and password that you set up with your datasource, so you shouldn't need them.

If you still can't figure it out though, I'd recommend emailing GoDaddy's support. They would be able to guide you better than I (as they obviously know their own system). Good luck though, and let me know if you figure it out.
Gjslick is offline   Reply With Quote
Old 03-08-2009, 08:49 PM   PM User | #5
lse123
Regular Coder

 
Join Date: Dec 2005
Posts: 702
Thanks: 0
Thanked 0 Times in 0 Posts
lse123 is infamous around these parts
Please note with godaddy.com we use phpMyAdmin ...

The below is correct if CustomersTable is a cfml variable ?

Code:
<cfquery name="getData" datasource="myDatasource">
  SELECT * FROM #CustomersTable#
</cfquery>
lse123 is offline   Reply With Quote
Old 03-08-2009, 09:01 PM   PM User | #6
Gjslick
Regular Coder

 
Join Date: Feb 2009
Location: NJ, USA
Posts: 476
Thanks: 2
Thanked 70 Times in 69 Posts
Gjslick will become famous soon enough
No, CustomersTable has to exist in your database, and you would not use # signs.
Gjslick is offline   Reply With Quote
Old 03-08-2009, 09:02 PM   PM User | #7
Gjslick
Regular Coder

 
Join Date: Feb 2009
Location: NJ, USA
Posts: 476
Thanks: 2
Thanked 70 Times in 69 Posts
Gjslick will become famous soon enough
By the way, is there an admin in GoDaddy for ColdFusion specific settings, rather than just php settings?
Gjslick is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 02:28 PM.


Advertisement
Log in to turn off these ads.