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
    Nov 2006
    Posts
    601
    Thanks
    1
    Thanked 2 Times in 2 Posts

    not echoing selected date in db

    ok i have my table set out like so
    Code:

    Code:
                  <label for="birthmonth">Birth Month:</label>
            <select class="input" name="birthmonth" id="birthmonth">  
    <option value="January" <?php if($birthmonth == 'January') echo 'selected'; ?>>January</option>
    <option value="Febuary"  <?php if($birthmonth == 'Febuary') echo 'selected'; ?>>Febuary</option>
    <option value="March" <?php if($birthmonth == 'March') echo 'selected'; ?>>March</option>
    <option value="April"  <?php if($birthmonth == 'April') echo 'selected'; ?>>April</option>
    <option value="May" <?php if($birthmonth == 'May') echo 'selected'; ?>>May</option>
    <option value="June"  <?php if($birthmonth == 'June') echo 'selected'; ?>>June</option>
    <option value="July" <?php if($birthmonth == 'July') echo 'selected'; ?>>July</option>
    <option value="August"  <?php if($birthmonth == 'August') echo 'selected'; ?>>August</option>
    <option value="September" <?php if($birthmonth == 'September') echo 'selected'; ?>>September</option>
    <option value="October"  <?php if($birthmonth == 'October') echo 'selected'; ?>>October</option>
    <option value="November" <?php if($birthmonth == 'November') echo 'selected'; ?>>November</option>
    <option value="December"  <?php if($birthmonth == 'December') echo 'selected'; ?>>December</option>

    what should happen is the previous selected dob is echod but its not... culd it be that i join them all together like so

    $birthyear = mysql_real_escape_string( $_POST['birthyear']);
    $birthmonth = mysql_real_escape_string( $_POST['birthmonth']);
    $birthday = mysql_real_escape_string( $_POST['birthday']);
    $dob = $birthday.'-'.$birthmonth.'-'.$birthyear;

    ??

  • #2
    Regular Coder
    Join Date
    Sep 2006
    Location
    Vermont, USA
    Posts
    154
    Thanks
    0
    Thanked 6 Times in 6 Posts
    Have you actually echo'd $birthmonth to see if it matches any of those cases - doing so might be revealing...
    Active PHP/MySQL application developer available for immediate work.
    syosoft.com mavieo.com - Remote Web Site Administration Suite - Reseller Ready

  • #3
    Regular Coder
    Join Date
    Nov 2006
    Posts
    601
    Thanks
    1
    Thanked 2 Times in 2 Posts
    yes i do... 19-December-1987 for example is what i get

  • #4
    Regular Coder
    Join Date
    Sep 2006
    Location
    Vermont, USA
    Posts
    154
    Thanks
    0
    Thanked 6 Times in 6 Posts
    when you echo $birthmonth? Well, how is that ever supposed to match one of your if conditions? That echo looks more like the output of $dob thou.
    Active PHP/MySQL application developer available for immediate work.
    syosoft.com mavieo.com - Remote Web Site Administration Suite - Reseller Ready

  • #5
    Regular Coder
    Join Date
    Nov 2006
    Posts
    601
    Thanks
    1
    Thanked 2 Times in 2 Posts
    woops sorry ok i selected December and it echo'd December
    as well as 19 been 19 and 1987 been 1987

  • #6
    Regular Coder
    Join Date
    Sep 2006
    Location
    Vermont, USA
    Posts
    154
    Thanks
    0
    Thanked 6 Times in 6 Posts
    So, is this solved?
    Active PHP/MySQL application developer available for immediate work.
    syosoft.com mavieo.com - Remote Web Site Administration Suite - Reseller Ready

  • #7
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,849
    Thanks
    160
    Thanked 2,223 Times in 2,210 Posts
    Blog Entries
    1
    runnerjp, use some loops to check/print the options.
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)

  • #8
    Regular Coder
    Join Date
    Nov 2006
    Posts
    601
    Thanks
    1
    Thanked 2 Times in 2 Posts
    its printing everything fine tho lol just not in the text boxes... im thinking that maybe its because its stored as $dob = $birthday.'-'.$birthmonth.'-'.$birthyear; would i have to break it down again or something?


  •  

    Posting Permissions

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