[php] fill form fields with data from database
Posted: Mon Jun 09, 2008 7:50 am
Hello!
Is that is possible to fill form fields with data from database without using JS or Ajax (or both)?
I have somthing like this but it doesn't work
I have some msql error :"Warning: mysql_fetch_object(): supplied argument is not a valid MySQL result resource in C:\Program Files\WebServ\my_www\admin\modyfikacja_nauczyciela.php on line 43"
Thnx for help
Is that is possible to fill form fields with data from database without using JS or Ajax (or both)?
I have somthing like this but it doesn't work
Code: Select all
$result = mysql_query("SELECT imie FROM nauczyciel ORDER BY nazwisko");
$result= mysql_query($result);
while ($field= mysql_fetch_object($result))
{
$field1 = $field->imie;
}
echo mysql_error() ;
<form method="POST">
<input type="text" name="fimie<?php $field1 ?>"> <br><br>
<input type="text" name="imie_nauczyciela" value="'.$imie.'"/>
</form>
Thnx for help