Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 8 of 8
  1. #1
    Regular Coder
    Join Date
    Dec 2005
    Posts
    702
    Thanks
    0
    Thanked 0 Times in 0 Posts

    <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 ?

  • #2
    Regular Coder
    Join Date
    Feb 2009
    Location
    NJ, USA
    Posts
    476
    Thanks
    2
    Thanked 70 Times in 69 Posts
    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?

  • #3
    Regular Coder
    Join Date
    Dec 2005
    Posts
    702
    Thanks
    0
    Thanked 0 Times in 0 Posts
    <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 ?

  • #4
    Regular Coder
    Join Date
    Feb 2009
    Location
    NJ, USA
    Posts
    476
    Thanks
    2
    Thanked 70 Times in 69 Posts
    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.

  • #5
    Regular Coder
    Join Date
    Dec 2005
    Posts
    702
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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>

  • #6
    Regular Coder
    Join Date
    Feb 2009
    Location
    NJ, USA
    Posts
    476
    Thanks
    2
    Thanked 70 Times in 69 Posts
    No, CustomersTable has to exist in your database, and you would not use # signs.

  • #7
    Regular Coder
    Join Date
    Feb 2009
    Location
    NJ, USA
    Posts
    476
    Thanks
    2
    Thanked 70 Times in 69 Posts
    By the way, is there an admin in GoDaddy for ColdFusion specific settings, rather than just php settings?

  • #8
    New to the CF scene
    Join Date
    Jul 2013
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Did you ever get it corrected? I am hosting with www.webestore.com and I am having some issues with SQL statement as well. Trying to pull data from the customer database table. Thanks.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •