Re: Dynamically build a form from mySQL table

From: Date: Tue, 20 Mar 2001 21:53:44 +0000
Subject: Re: Dynamically build a form from mySQL table
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-7662@lists.php.net to get a copy of this message
If you are using MySQL you can use the "mysql_list_fields" to get the fields names from a table. HTH Jayme. -----Mensagem Original----- De: Martin E. Koss <mek@mek.co.uk> Para: <php-db@lists.php.net> Enviada em: terça-feira, 20 de março de 2001 12:02 Assunto: [PHP-DB] Dynamically build a form from mySQL table > Hi, > I've been trying to figure this out by looking through the code in > phpMyAdmin but I'm not getting very far. > > What I want to do is dynamically generate a form where I get a table row > containing the field name in one cell and the input field in the next cell, > for example: > > $DatabaseName = "FocusDynamics"; > $TableName = "Items"; > > // open the table and get all field names, sizes, etc., > > // for each Field name, print something like: > > PRINT "<tr>\n"; > PRINT "<td>$FieldName</td>\n"; > PRINT "<td><input type=\"text\" name=\"$FieldName\" > value=\"$FieldValue\" > maxlength=\"FieldSize\"></td>\n"; > PRINT "</tr>"; > > How do I get all this info from the table? > > Thanks for any help. > > > Martin E. Koss > M: 07946-706459 > E: mek@mek.co.uk > > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-db-unsubscribe@lists.php.net > For additional commands, e-mail: php-db-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net >

« previous php.db (#7662) next »