In article [EMAIL PROTECTED], [EMAIL PROTECTED]
says...
Hi,
I've been thinking about this for a while, and I think I'd get a lot of
value out of a library which builds user-input forms from scratch, based
on the MySQL table.
If I had a simple table for a CD catalogue:
id (INT 4)
artist_id (INT 4)
description (MEDIUM TEXT)
price (VARCHAR 7)
Then I'd love to be able to build a form for entry of each new CD, based
on the column names and types in the above table:
FORM action=blah.php action=post
Bartist_id/B: INPUT type=text name=artist_id value=
length=4 maxlength=4BR
Bdescription/B: TEXTAREA name=description rows=5 cols=40BR
Bprice/B: INPUT type=text name=price value= length=7 maxlength=7BR
INPUT type=submit name=submit value=submit
/FORM
So, my question is, how do efficiently establish the data type, length
and name of each field.
The rest, I think I can handle :)
Thanks in advance,
Justin French
Have a look at mysql_field_type() from which you should be able to build
something along the lines of what you want. You might also peer into the
innards of phpMyAdmin, which does the same sort of thing.
Cheers
--
David Robley
Temporary Kiwi!
Quod subigo farinam
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php