*newbie* connecting to sql

Ask a Question related to Coldfusion Database Access, Design and Development.

  1. #1

    Default *newbie* connecting to sql

    I want to connect to my db, not sure how. In php I used:

    $user_connection = mysql_connect($host, $user_id, $password)
    or die ("Couldn't connect to server.");
    $db = mysql_select_db('tablename', $user_connection)
    or die ("Could not connect to db.");

    where
    $host="sqlserver"; /*on a network, NOT localhost*/
    $user_id="myid";
    $password="mypassword";

    how do I do this in CF? thank you!

    stupidstanly Guest

  2. Similar Questions and Discussions

    1. A newbie with a newbie question
      Good afternoon everyone, My Name is Dusty I am new to this forum and pretty new to Acrobat. I have Acrobat 9 running on an IMAC running 10.5.2 I...
    2. connecting...
      we're having a hard time connecting to the server so we can let others make changes to the pages. we know we can connect to the server through our...
    3. connecting FMS
      Im really new to FMS and have installed it but im slightly confused as to what i enter into the Server address section when loging in! or where i...
    4. ASP.NET connecting to SQL DB
      I'm having trouble connecting to an SQL database in Dreamweaver. I've typed in the correct parameters, but I get an "Http Error Code 403 Forbidden"...
    5. Connecting G5 to a TV
      I am thinking of ordering a G5 but have only the money to buy the machine plus software. I want to replace my 3 year old imac. Since I have an...
  3. #2

    Default *newbie* connecting to sql

    I want to connect to my db, not sure how. In php I used:

    $user_connection = mysql_connect($host, $user_id, $password)
    or die ("Couldn't connect to server.");
    $db = mysql_select_db('tablename', $user_connection)
    or die ("Could not connect to db.");

    where
    $host="sqlserver"; /*on a network, NOT localhost*/
    $user_id="myid";
    $password="mypassword";

    how do I do this in CF? thank you!

    forumnotifier Guest

  4. #3

    Default Re: *newbie* connecting to sql

    Typically you would create a datasource in the CF Administrator. The
    datasource settings vary based on database and connection type. Once you
    create the datasource, it can then be used in cfqueries.

    <cfquery name="getData" datasource="myNewDatasource">
    SELECT something FROM someTable
    </cfquery>

    mxstu Guest

  5. #4

    Default Re: *newbie* connecting to sql

    Check out [url]http://tutorial2.easycfm.com/[/url]



    Dan Phillips
    CFXHosting.com
    dphillipsCFX Guest

Posting Permissions

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

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 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139