Hey guys, may be basic q, how can I pull some thing from mysql and put it into a form field. Lile name into name field in form? Thanks.
mysql_connect('host', 'user', 'password') or exit(mysql_error()); mysql_select_db('db') or exit(mysql_error()); $result = mysql_query('SELECT name FROM table') or exit(mysql_error()); while ($row = mysql_fetch_assoc($result)) { echo '<input type="text" name="name" value="' . $row['name'] . '">'; }
Pretty cool, what if I want it in a field of an existing form? Like this:
Name: [MYSQL Name inserted here] Address: [MYSQL address inserted here]
I want the field in my existing form to be populated..thanks a ton appreciate it..