By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,949 Members | 1,827 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,949 IT Pros & Developers. It's quick & easy.

Field sizeof function

P: n/a

I can find no PHP function that returns the maximum limit of field. For
instance, when I see "varchar(256)" for the specification of a field, it's
the number "256" I am interested in. Or perhaps what I am really
interested in is both the type and the number of bytes a field is allocated
(maximum permitted, not actually maximum used in a table with fields)

So anyone know what MySQL query function I would use to get info on a
field? The object properties returned by PHP function 'mysql_fetch_field'
do not give me what I want.
As to why I want it, I want to set up a dynamic add/edit-data form in an
HTML page with text and textarea controls, the size/maxlength/rows/columns
of which are based on the number of characters allowed to set a value for a
field based on its type and byte size.
Oct 27 '08 #1
Share this Question
Share on Google+
1 Reply


P: n/a
On Mon, 27 Oct 2008 14:27:30 +0100, Patient Guy
<sevisen.adam@gmaildotherecomwrote:
>
I can find no PHP function that returns the maximum limit of field. For
instance, when I see "varchar(256)" for the specification of a field,
it's
the number "256" I am interested in. Or perhaps what I am really
interested in is both the type and the number of bytes a field is
allocated
(maximum permitted, not actually maximum used in a table with fields)

So anyone know what MySQL query function I would use to get info on a
field? The object properties returned by PHP function
'mysql_fetch_field'
do not give me what I want.
comp.databases.mysql?

SHOW FULL COLUMNS FROM tablename;
DESCRIBE tablename;
As to why I want it, I want to set up a dynamic add/edit-data form in an
HTML page with text and textarea controls, the
size/maxlength/rows/columns
of which are based on the number of characters allowed to set a value
for a
field based on its type and byte size.
You could learn a lot by looking through phpMyAdmin's code.
--
Rik
Oct 27 '08 #2

This discussion thread is closed

Replies have been disabled for this discussion.