Results 1 to 2 of 2

Thread: get data make selection option

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Jun 2005
    Posts
    1,170

    get data make selection option

    Hey guys, I am stuck with this logic. Say I have a form


    Code:
    <select name="Birth_Month">
    <option value="">(Month)</option>
    <option value="01">Jan</option>
    <option value="02">Feb</option>
    <option value="03">Mar</option>
    <option value="04">Apr</option>
    <option value="05">May</option>
    <option value="06">Jun</option>
    <option value="07">Jul</option>The user selected one field, and that field's value is stored in the mysql database. My question is, if the user wants to come back to the page, and select "Edit". .. Then he/she should get a form that his Birth_month's value has already been selected for him. I did the select * query

    PHP Code:
    <?php echo "value=\"$row[6]\"";?>>
    The $row[6] is the row that contain that user's month info. But I don't know how can I use that row to insert into those option box?

  2. #2
    PowerPoster lintz's Avatar
    Join Date
    Mar 2003
    Location
    The 19th Hole
    Posts
    2,697

    Re: get data make selection option

    If the users birthday was in June then this would be the code

    PHP Code:
    <option value="06" selected>Jun</option

Posting Permissions

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



Click Here to Expand Forum to Full Width