[PHP] field types

2001-01-23 Thread Jason Jacobs

Does anyone know a function to give me the mySql field types?  I saw the
function mysql_field_type, but that returns php types not mysql.  What I
wanna do is if the type of the field is "Text" then I wanna make a
"textarea" to edit and add stuff.  Thanks.

Jason


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] field types

2001-01-23 Thread Boget, Chris

 Does anyone know a function to give me the mySql field types? 
  I saw the function mysql_field_type, but that returns php types not 
 mysql.  What I wanna do is if the type of the field is "Text" then I 
 wanna make a "textarea" to edit and add stuff.  Thanks.

If you have phpMySql, take a look at the file:

/mysqladmin/tbl_properties.php

That code is doing something to return the type of the field.  It's a
little hard to follow so I don't know exactly how he's doing it and
unfortunately, didn't have the time to decipher. :p  However, I'm
sure if you sat down with it for a while, you'd figure out how he
did it.

Chris



RE: [PHP] field types

2001-01-23 Thread Boget, Chris

 If you have phpMySql, take a look at the file:
 /mysqladmin/tbl_properties.php
 That code is doing something to return the type of the field.  It's a
 little hard to follow so I don't know exactly how he's doing it and
 unfortunately, didn't have the time to decipher. :p  However, I'm
 sure if you sat down with it for a while, you'd figure out how he
 did it.

Never mind, I see how he did it.  He runs the following query:

"SELECT FIELDS FROM $tableName"

Where '$tableName' is your table (obviously) and he parses the result
to get all the information.

HTH

Chris



RE: [PHP] field types

2001-01-23 Thread Joao Prado Maia


On Tue, 23 Jan 2001, Boget, Chris wrote:

 Never mind, I see how he did it.  He runs the following query:
 
 "SELECT FIELDS FROM $tableName"
 
 Where '$tableName' is your table (obviously) and he parses the result
 to get all the information.
 

Actually he did a "SHOW FIELDS FROM $tableName". It looks like it's some
sort of alias to "DESC $tableName", since it shows pretty much the same
data.

Joao

--
Joo Prado Maia [EMAIL PROTECTED]
http://phpbrasil.com - php com um jeitinho brasileiro


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]