Re: mysql table information

From: Date: Fri, 02 Nov 2001 14:51:59 +0000
Subject: Re: mysql table information
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-73267@lists.php.net to get a copy of this message
Take a look at that: http://www.mysql.com/doc/S/H/SHOW.html and http://www.mysql.com/doc/D/E/DESCRIBE.html I fear you have to parse necessary information out of a statment like this: $result = mysql_query("DESCRIBE yourTable"); $tabelDesc = mysql_fetch_array($result); I didn't spend any time checking it but I think it could work. Good luck! PS: if you make progress with that I was also interested in informations about this kind of stuff - please send a mail :) Stefan Rusterholz, s.rusterholz@interaktion.ch ---------------------------------- interaktion gmbh Stefan Rusterholz Zürichbergstrasse 17 8032 Zürich ---------------------------------- T. +41 1 253 19 55 F. +41 1 253 19 56 W3 www.interaktion.ch ---------------------------------- ----- Original Message ----- From: "Justin French" <justin@indent.com.au> To: "php" <php-general@lists.php.net> Sent: Friday, November 02, 2001 3:02 PM Subject: [PHP] mysql table information > hi, > > i was wondering if anyone has some sample code / links which could help > me generate HTML forms dynamically from the fields/types/lengths of > tables in a mySQL database. > > ie, if i had a three column table with first (varchar 50), last (varchar > 80) & bio (medium text) as the columns, it'd be great if i could use > this information about the *table* to build a html form. > > in otherwords, I could generate an <INPUT> named "first" who's max > length was 50, annother called "last" with a maxlength of 80, and a > <TEXTAREA> named "bio" for the medium text, etc etc. > > > sorry i can't describe it any better!! > > > i guess programs like phpMyAdmin achieve this, but i'd rather see a > small code snippet and LEARN rather than dig through 1000's of lines of > phpMyAdmin code :) > > > thanks, > > justin french > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net > > >

« previous php.general (#73267) next »