SitePoint Sponsor

User Tag List

Page 2 of 2 FirstFirst 12
Results 26 to 40 of 40
  1. #26
    SitePoint Wizard bronze trophy Kailash Badu's Avatar
    Join Date
    Nov 2005
    Posts
    2,560
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Good luck

  2. #27
    SitePoint Guru
    Join Date
    Dec 2005
    Posts
    964
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Now... If i want to display inserted data in a listbox? How do I go about that?

  3. #28
    SitePoint Wizard bronze trophy Kailash Badu's Avatar
    Join Date
    Nov 2005
    Posts
    2,560
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    show me the code where you display listbox and I will tell what you need to do?

  4. #29
    SitePoint Guru
    Join Date
    Dec 2005
    Posts
    964
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'm still using the $currUser['Letter*]
    Code:
          
    <select name="Letter" class="textarea" id="Letter">
            <option>..</option>
            <option value="1">A</option>
            <option value="2">B</option>
            <option value="3">C</option>
          </select>
    Hope this is enough

  5. #30
    SitePoint Wizard bronze trophy Kailash Badu's Avatar
    Join Date
    Nov 2005
    Posts
    2,560
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    PHP Code:
    $currUser[‘Letter’] = $row[‘Letter’] //assign from database


    <select name="Letter" class="textarea" id="Letter">
            <option>..</option>
            <option value="1" <?php if($currUser[‘Letter’]='1'
                    
    print  "selected=\"selected\"";?>>A</option>
            <option value="2" <?php if($currUser[‘Letter’]='2'
                    
    print  "selected=\"selected\"";?>>B</option>
            <option value="3" <?php if($currUser[‘Letter’]='3'
                    
    print  "selected=\"selected\"";?>>C</option>
          </select>

  6. #31
    SitePoint Guru
    Join Date
    Dec 2005
    Posts
    964
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I Get following error when I insert the code!

    Parse error: syntax error, unexpected T_PRINT in /hsphere/local/home/jmansa/norway.3dgolfguide.com/clubadmin/update.php on line 87

    Line 87 = print "selected="selected"";?>>A</option>

    Any idea?

  7. #32
    SitePoint Wizard bronze trophy Kailash Badu's Avatar
    Join Date
    Nov 2005
    Posts
    2,560
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Use this one:

    PHP Code:
    $currUser[‘Letter’] = $row[‘Letter’] //assign from database


    <select name="Letter" class="textarea" id="Letter">
            <option>..</option>
            <option value="1" <?php if($currUser[‘Letter’]=='1')
                    print  
    "selected=\"selected\"";?>>A</option>
            <option value="2" <?php if($currUser[‘Letter’]=='2')
                    print  
    "selected=\"selected\"";?>>B</option>
            <option value="3" <?php if($currUser[‘Letter’]=='3')
                    print  
    "selected=\"selected\"";?>>C</option>
          </select>

  8. #33
    SitePoint Guru
    Join Date
    Dec 2005
    Posts
    964
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    That helped, but... It changes the record in the database but I am not able to see it in the form. It still doesnt show what letter the club have choosen?!?

  9. #34
    SitePoint Wizard bronze trophy Kailash Badu's Avatar
    Join Date
    Nov 2005
    Posts
    2,560
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Doesn't it help?
    PHP Code:
     $currUser[‘Letter’] = $_POST‘Letter’] //from the form

    <select name="Letter" class="textarea" id="Letter">
            <option>..</option>
            <option value="1" <?php if($currUser[‘Letter’]=='1')
                    print  
    "selected=\"selected\"";?>>A</option>
            <option value="2" <?php if($currUser[‘Letter’]=='2')
                    print  
    "selected=\"selected\"";?>>B</option>
            <option value="3" <?php if($currUser[‘Letter’]=='3')
                    print  
    "selected=\"selected\"";?>>C</option>
          </select>

  10. #35
    SitePoint Guru
    Join Date
    Dec 2005
    Posts
    964
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Sorry... Still no post?!?

  11. #36
    SitePoint Wizard bronze trophy Kailash Badu's Avatar
    Join Date
    Nov 2005
    Posts
    2,560
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Now place this in the code:

    PHP Code:
    print_r[$POST); 
    submit the form and post the output so that i could see it.

  12. #37
    SitePoint Guru
    Join Date
    Dec 2005
    Posts
    964
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Array ( [0] => 101 [ClubID] => 101 [1] => 1 [Letter] => 1 [3] => Test [ClubName] => Test)

  13. #38
    SitePoint Wizard bronze trophy Kailash Badu's Avatar
    Join Date
    Nov 2005
    Posts
    2,560
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Sorry, I think it should have worked.

    You need to show me the whole code.

  14. #39
    SitePoint Addict Robert_2006's Avatar
    Join Date
    Jun 2006
    Location
    Tarpon Springs Fl.
    Posts
    265
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    jmansa,

    You should read some tutorials and perhaps purchase a book. I think it will help you grow as a programmer.
    Quote Originally Posted by jmansa
    Sorry... Still no post?!?
    This comment is just rude. Kailash has been writting this for you and you put him on the spot.

  15. #40
    SitePoint Guru
    Join Date
    Dec 2005
    Posts
    964
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Soory... Found the error... Syntax error. Solved. Thanx


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
  •