Loading textfields from database

Discussion in 'MySQL' started by lost, Nov 29, 2005.

  1. #1
    i have a form with x number of textfields, when the user selects load, i need to fill in the textfields with the data from the database.
    how would i go about doing the load???
     
    lost, Nov 29, 2005 IP
  2. webbom

    webbom Well-Known Member

    Messages:
    971
    Likes Received:
    26
    Best Answers:
    0
    Trophy Points:
    170
    #2
    I'm not sure what you mean with "user selects load" but I think it should be farily easy. Make a call to the database and populate the value of the textfield with your database data.
     
    webbom, Nov 29, 2005 IP
  3. Highwire

    Highwire Banned

    Messages:
    29
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Wth u talking about give me more detail ?? i am confuse from wat u saying
     
    Highwire, Nov 30, 2005 IP
  4. LouisR

    LouisR Peon

    Messages:
    29
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Do you mean a simple mysql query? Sounds really basic, but I'm bored.
    
    
    <?php
    // Connect to mysql and database
    
    $query=mysql_query("select field from table");
    while($row=mysql_fetch_array($query)){
    $field=$row['field']; }
    ?>
    <input type="text" value="<?=$field?>">
    
    
    PHP:
     
    LouisR, Dec 8, 2005 IP