Skip to main content
nurcanb61753314
Inspiring
September 17, 2019
Question

How can ı connect the local database?

  • September 17, 2019
  • 2 replies
  • 353 views

hello ,

Iam workıng at local database.I add a new database.ıts workıng.but ı dont know that how can ı connect ıt?Are there any wrong at code?

table name: KAYITYEN

Datasource:DENEME

 

<cfquery name="ADD_BUDGET" datasource="#DENEME#">

                                               INSERT INTO

                                                               KAYITYEN

                                               (

                                                 AD,

                                                 SOYAD

                                               )

                                               VALUES

                                               (

                                                               <cfqueryparam cfsqltype="cf_sql_varchar" value="#attributes.AD#">,

                                                               <cfqueryparam cfsqltype="cf_sql_varchar" value="#attributes.SOYAD#">

                                                               )

                                                              

                               </cfquery>

 

    This topic has been closed for replies.

    2 replies

    Charlie Arehart
    Community Expert
    Community Expert
    September 17, 2019

    You ask how you can "connect" the database, though it's "working". So are you saying you HAVE created the datasource (DENEME) and CAN query it from cf, but that THIS one query fails? What is the error?

     

    And looking at the code, you refer to your variables with the attributes scope. That has a very specific meaning--that the code is running inside a cf "custom tag" template. If your code is not in such a custom tag, you should not be using that attributes scope.

     

    From your two most recent questions, it sounds like you are brand new to CF. If so, welcome. But what introductory resources have you read? If you're just copying code snippets from various places and trying to make them work, that will prove challenging.

     

    I'd recommend you check out any of the many intro resources I list here :

     

    http://www.cf411.com/cftrainingfree

     

    Especially "learn cf in a week", "learn cfml in 100 minutes", "learn modern cfml in 100 minutes", all from community members, or the several hours of "getting started" videos from Adobe. Even just an hour in any one of these should help at the level it seems you may be at. Apologies if I have misread your level of experience with CF. As always, just trying to help. 

    /Charlie (troubleshooter, carehart. org)
    nurcanb61753314
    Inspiring
    September 17, 2019
    yeah ıam new true.Thank u ı wıll at them.and ı can solve now connect,query lıke thıs.Now ı must solve add,delete and like that
    Abambo
    Community Expert
    Community Expert
    September 17, 2019

    I moved this to the Cold Fusion forum. I guess that is where it belongs. If not, please state the Adobe program you're using...

    ABAMBO | Hard- and Software Engineer | Photographer