Jump to content

Archived

This topic is now archived and is closed to further replies.

westnyorai

mysql_field_type-help returning sql type , and not php type

Recommended Posts

I'm working on creating a database management script for my site. I'm having issues creating a script that will allow users to make changes to field names and datatypes.

But I'm having issues returning the SQL field type instead of the PHP field type.

The mysql_fieldtype command only returns string, num, blog, etc. instead of varchar, char, and such.

Is there a way I can use SQL to query the information and then fetch it?

Share this post


Link to post
Share on other sites
DESCRIBE mytablename

[a href=\"http://dev.mysql.com/doc/refman/5.0/en/describe.html\" target=\"_blank\"]http://dev.mysql.com/doc/refman/5.0/en/describe.html[/a]

Share this post


Link to post
Share on other sites
[!--quoteo(post=361774:date=Apr 4 2006, 06:23 PM:name=wickning1)--][div class=\'quotetop\']QUOTE(wickning1 @ Apr 4 2006, 06:23 PM) [snapback]361774[/snapback][/div][div class=\'quotemain\'][!--quotec--]
DESCRIBE mytablename

[a href=\"http://dev.mysql.com/doc/refman/5.0/en/describe.html\" target=\"_blank\"]http://dev.mysql.com/doc/refman/5.0/en/describe.html[/a]
[/quote]

ah, cool, that actually saves me a lot more time then using php. thanks, but now i have to figure out how to return only certain parts to php, but that shouldn't be too difficult. I'll work on it later tonight after i get back from class/work

Share this post


Link to post
Share on other sites
Doesn't 5.0 have magic INFORMATION_SCHEMA functions for this?

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.