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 3 of 3
  1. #1
    New Coder
    Join Date
    Jun 2010
    Posts
    13
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Arrow select options in php

    working this code..i didn't get schemeid when selecting the listbox items..pls help
    <select name="lstscheme">
    <?php
    print '<option value="">--Select--</option>';
    while(count($Result)>$i)
    {
    $SchemeId=$_POST['lstscheme'];
    print $SchemeId=$Result[$i]['scheme_id'];
    print $Schemehours=$Result[$i]['scheme_hours'];
    print '<option value="'.$SchemeId.'" >'.$SchemeId.'</option>';
    $i++;
    }
    ?>
    </select>

  • #2
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    PHP Code:
    <select name="lstscheme">
    <?php
    print '<option value="">--Select--</option>';
    while(
    count($Result)>$i)
    {
    $SchemeId=$Result[$i]['scheme_id'];
    $Schemehours=$Result[$i]['scheme_hours'];
    print 
    '<option value="'.$SchemeId.'" >'.$SchemeId.'</option>';
    $i++;
    }
    ?>
    </select>
    Try that. You tried to print. I suggest you learn the basics of php. It doesn't seem that you have a grasp at it yet. You've been making very simple mistakes.
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • Users who have thanked _Aerospace_Eng_ for this post:

    bamboli (06-21-2010)

  • #3
    New Coder
    Join Date
    Jun 2010
    Posts
    13
    Thanks
    1
    Thanked 0 Times in 0 Posts
    thanks for giving the correct code...


  •  

    Posting Permissions

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