How to create dynamic Form using php & Mysql ??

Discussion in 'PHP' started by VishalVasani, Oct 1, 2007.

  1. #1
    Hello,

    Any one has any idea how to generate a form using mysql & Php. All the fields in the form are dynamic depending on mysql database table entry....

    Please advice on this....
     
    VishalVasani, Oct 1, 2007 IP
  2. PoemofQuotes

    PoemofQuotes Peon

    Messages:
    637
    Likes Received:
    21
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Just fetch the MySQL stuff, then place it within the form using php:

    
    $s1 = mysql_query("SELECT * FROM `banana`");
    while ($pie = mysql_fetch_array($s1)) {
    print("<form>
    <input type=\"text\" name=\"pie_crust\" value=\"$pie['crust']\" />
    <input type=\"text\" name=\"pie_flavor\" value=\"$pie['flavor']\" />
    </form>
    ")
    }
    
    Code (markup):
     
    PoemofQuotes, Oct 1, 2007 IP