Skip to main content
felixm71880667
Participating Frequently
Dec 6, 2015 7:14 PM UTC
Answered

Felix Mayowa

Good day everyone please i'm a beginner in coldfusion. i really need your help i've read books about coldfusion but i dont understand them.  is there any book for a beginner like me

    This topic is closed to new replies. Start a new post to keep the conversation going.
    BKBK
    BKBKCorrect answer
    Community Expert
    Dec 6, 2015 8:32 PM UTC

    Hi Felix, welcome to the world of ColdFusion. Which books have you been reading?

    Search the web for Coldfusion tutorials for beginners. I would recommend Learn CF in a Week. You should return to this forum with any questios you may have.

    34 replies

    felixm71880667
    Participating Frequently
    Dec 11, 2015 10:52 PM UTC

    God Bless you all.

    i have found solution to my problem. I love you all

    Translate
    BKBK
    Community Expert
    Community Expert
    Dec 12, 2015 8:28 AM UTC

    felixm71880667 wrote:

    God Bless you all.

    i have found solution to my problem. I love you all

    I am glad to hear. Could you please describe here your solution here. It will help someone else in future. Thanks for the love.

    Translate
    felixm71880667
    Participating Frequently
    Dec 12, 2015 9:06 AM UTC

    <cfif isDefined("form.save")> 

         <cfset felix = "#form.dob#" />

           <cfset #form.dob# = "#felix#" />

           <cfdump var="#form#"/>

      </cfif>

    <!---Date--->

    <div class="form-group">

      <input class="form-control" type="date" name="dob">

      </div>

    <!---End of Date--->

    that's how i corrected it

    Translate
    felixm71880667
    Participating Frequently
    Dec 11, 2015 4:10 PM UTC

    so how do i go about it in the select element.

    Translate
    BKBK
    Community Expert
    Community Expert
    Dec 11, 2015 8:27 PM UTC

        '#Form.sex#'

      <cfqueryparam value="#Form.sex#" cfsqltype="cf_sql_char">

    or

    <cfqueryparam value="#Form.sex#" cfsqltype="cf_sql_varchar">

    can't cast [23,9,1993] to date value

    That's the error i'm getting

    The error message is obvious enough. I think 23-09-1993 or 23/09/1993 would work.

    Translate
    felixm71880667
    Participating Frequently
    Dec 11, 2015 12:37 PM UTC

    please help me

    Translate
    Inspiring
    Dec 11, 2015 12:43 PM UTC

    Help with what? BKBK gave you the solution to your last problem, which appeared to be a typo. You still have not corrected the type. "dateofbitrh" is still incorrect.

    Translate
    felixm71880667
    Participating Frequently
    Dec 11, 2015 1:02 PM UTC

    i have corrected it but its still not working. check it out again.

    <!---Beginning of Database--->

      <cfif isDefined("form.save")>

      <cfset today = Now()>

      <cfquery name="feltec" datasource="#Request.MainDSN#">

      INSERT INTO user(

      username,

      firstname,

      lastname,

      email,

      password,

      retypepassword,

      phone,

      address,

      dateofbirth,

      sex,

      optionphone

      )

      VALUES(

      <cfqueryparam value="#Form.username#" cfsqltype="cf_sql_varchar">,

      <cfqueryparam value="#Form.firstname#" cfsqltype="cf_sql_varchar">,

      <cfqueryparam value="#Form.lastname#" cfsqltype="cf_sql_varchar">,

      <cfqueryparam value="#Form.email#" cfsqltype="cf_sql_varchar">,

      <cfqueryparam value="#Form.password#" cfsqltype="cf_sql_varchar">,

      <cfqueryparam value="#Form.retypepassword#" cfsqltype="cf_sql_varchar">,

      <cfqueryparam value="#Form.phone#" cfsqltype="cf_sql_varchar">,

      <cfqueryparam value="#Form.address#" cfsqltype="cf_sql_varchar">,

      <cfqueryparam value = '#form.dateofbirth#' cfsqltype = "cf_sql_date">,

      '#Form.sex#',

      <cfqueryparam value="#Form.optionphone#" cfsqltype="cf_sql_varchar">

      )

      </cfquery>

      </cfif>

    <!---End of database--->

    Translate
    felixm71880667
    Participating Frequently
    Dec 11, 2015 12:29 PM UTC

    not still working

    <cfif isDefined("form.save")>

      <cfset today = Now()>

      <cfquery name="feltec" datasource="#Request.MainDSN#">

      INSERT INTO user(

      username,

      firstname,

      lastname,

      email,

      password,

      retypepassword,

      phone,

      address,

      dateofbitrh,

      sex,

      optionphone

      )

      VALUES(

      <cfqueryparam value="#Form.username#" cfsqltype="cf_sql_varchar">,

      <cfqueryparam value="#Form.firstname#" cfsqltype="cf_sql_varchar">,

      <cfqueryparam value="#Form.lastname#" cfsqltype="cf_sql_varchar">,

      <cfqueryparam value="#Form.email#" cfsqltype="cf_sql_varchar">,

      <cfqueryparam value="#Form.password#" cfsqltype="cf_sql_varchar">,

      <cfqueryparam value="#Form.retypepassword#" cfsqltype="cf_sql_varchar">,

      <cfqueryparam value="#Form.phone#" cfsqltype="cf_sql_varchar">,

      <cfqueryparam value="#Form.address#" cfsqltype="cf_sql_varchar">,

      <cfqueryparam value = '#form.dateofbirth#' cfsqltype = "cf_sql_date">,

      '#Form.sex#',

      <cfqueryparam value="#Form.optionphone#" cfsqltype="cf_sql_varchar">

      )

      </cfquery>

      </cfif>

    <!---End of database--->

    Translate
    felixm71880667
    Participating Frequently
    Dec 11, 2015 11:50 AM UTC

    <select name="dateofbirth" id="birthday" required>

      <option>Days</option>

      <cfloop index="i" from="1" to="31">

      <cfoutput><option value="#i#">#i#</option></cfoutput>

      </cfloop>

      </select>

      <select name="dateofbirth" id="birthday" required>

      <option>Month</option>

      <cfloop index="i" from="1" to="12">

      <cfoutput>

      <option value="#i#">#monthAsString(i)#</option>

      </cfoutput>

      </cfloop>

      </select>

      <select name="dateofbirth" id="birthday" required>

      <option>Year</option>

      <cfloop index="i" from="1901" to="2015">

      <cfoutput>

      <option value="#i#">

      #i#

      </option>

      </cfoutput>

      </cfloop>

      </select>

    Translate
    felixm71880667
    Participating Frequently
    Dec 9, 2015 9:09 PM UTC

    Thanks to everyone. I really appreciate this family.

    Translate
    Carl Von Stetten
    Legend
    Dec 9, 2015 9:13 PM UTC

    felixm71880667‌ I'm going to mark the first answer from BKBK‌ as Correct, since it addressed your original question.  If you run into any additional problems, or need more help on the query issue above, we'll carve the whole query discussion off to a separate topic to keep the discussion thread easier to follow.

    -Carl V. - Moderator

    Translate
    felixm71880667
    Participating Frequently
    Dec 11, 2015 12:34 AM UTC

    stii can't cast the date of birth to Date value. please help

    Translate
    BKBK
    Community Expert
    BKBKCommunity ExpertCorrect answer
    Community Expert
    Dec 6, 2015 8:32 PM UTC

    Hi Felix, welcome to the world of ColdFusion. Which books have you been reading?

    Search the web for Coldfusion tutorials for beginners. I would recommend Learn CF in a Week. You should return to this forum with any questios you may have.

    Translate
    felixm71880667
    Participating Frequently
    Dec 6, 2015 8:50 PM UTC

    Thank You. but it is not explanatory. I read coldfusion developers guide 9. I cant apply it to a real practical

    Translate
    BKBK
    Community Expert
    Community Expert
    Dec 6, 2015 9:21 PM UTC

    The Adobe Developer Guide is perhaps too advanced for the beginner. Have you had a look at the LearnCFInAWeek tutorial? It has plenty of pactical examples.

    Translate