Results 1 to 2 of 2

Thread: I need HELP! - I'm new at this!

  1. #1
    Join Date
    Feb 2009
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Exclamation I need HELP! - I'm new at this!

    I have a website www.micomunidad.com but when someone registers and chooses 'MARCH' as their month of birth, it appears "APRIL" in their profile! The table is 'birth_month'

    I went to MySQLAdmin and I see this:

    Rows birth_month
    226 NULL
    142 0
    93 1
    110 10
    125 11
    1 12
    82 2
    81 3
    73 4
    92 5
    91 6
    94 7
    85 8
    109 9

    I see that row 142 is 0 - I supposed that's the month of JANUARY

    Now this is the code in my php file

    <select name="month">
    <?php

    $sr_no=1;
    while($sr_no!=13)
    {
    if($now_month==$sr_no)
    {
    ?>
    <option value="<?=$sr_no?>" selected><?=$month[$sr_no]?></option>
    <?php
    }
    else
    {
    ?>
    <option value="<?=$sr_no?>"><?=$month[$sr_no]?></option>
    <?php
    }
    $sr_no=$sr_no+1;
    }
    ?>
    </select>

    I don't know what to do if to change the Db and replace the row 142 to 1, 93 to 1, and so on...

    If I need to do this what is the command to change this in MYSQLAdmin? and or edit the code in my php code?

    Thank you in advance!


  2. #2
    Join Date
    Oct 2008
    Posts
    60
    Thanks
    2
    Thanked 7 Times in 7 Posts

    Default I need HELP! - I'm new at this!

    why dont you use the month in a drop down. then when they click submit, the month gets stored in the database? im not the best at what you are trying to do, but i figured it would be best to just store the value of the drop down in the database

Bookmarks

Posting Permissions

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