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

    listbox selection

    i am a beginner in php....
    i try to print vaues in to textboxes corresponding listbox item selection...
    now i got only the last database values in to the textboxes...

    PHP Code:
    $DB=new database();
    $scheme=new Scheme($DB,$SchemeId,$UserId,$Schemehours,$SchemeAmount);
    $a=array();
    $a=$scheme->displayschemehours($SchemeId);
    $i=0;
    if(
    count($a)>$i)
    {
    $Schemehours=$a[$i]['scheme_hours'];
    $SchemeAmount=$a[$i]['scheme_amount'];
    $i++;

    Code:
    <input type="text" name="txtschemehours"  value="<? print $Schemehours?>"   /> 
    <input type="text"  name="txtschemeamount" value="<? print $SchemeAmount?>" />
    pls give a solution

  • #2
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,854
    Thanks
    160
    Thanked 2,223 Times in 2,210 Posts
    Blog Entries
    1
    pls give a solution
    If you want to show all the fetched values from DB in separate text fields, then you need to move the text fields also into the loop.
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)


  •  

    Posting Permissions

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