Skip to main content
felixm71880667
Participating Frequently
December 6, 2015
Answered

Felix Mayowa

  • December 6, 2015
  • 7 replies
  • 2583 views

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 has been closed for replies.
    Correct answer BKBK

    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.

    7 replies

    felixm71880667
    Participating Frequently
    December 11, 2015

    God Bless you all.

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

    BKBK
    Community Expert
    Community Expert
    December 12, 2015

    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.

    felixm71880667
    Participating Frequently
    December 12, 2015

    <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

    felixm71880667
    Participating Frequently
    December 11, 2015

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

    BKBK
    Community Expert
    Community Expert
    December 11, 2015

        '#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.

    felixm71880667
    Participating Frequently
    December 11, 2015

    please help me

    Inspiring
    December 11, 2015

    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.

    felixm71880667
    Participating Frequently
    December 11, 2015

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

    felixm71880667
    Participating Frequently
    December 11, 2015

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

    felixm71880667
    Participating Frequently
    December 11, 2015

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

    felixm71880667
    Participating Frequently
    December 9, 2015

    Thanks to everyone. I really appreciate this family.

    Carl Von Stetten
    Legend
    December 9, 2015

    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

    felixm71880667
    Participating Frequently
    December 11, 2015

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

    BKBK
    Community Expert
    BKBKCommunity ExpertCorrect answer
    Community Expert
    December 6, 2015

    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.

    felixm71880667
    Participating Frequently
    December 6, 2015

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

    BKBK
    Community Expert
    Community Expert
    December 6, 2015

    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.