Balmung-San Posted March 16, 2006 Share Posted March 16, 2006 Alright, I'm trying to write a program that requires me to have many tables, however the tables will have varying field names and I'd like a way to dynamically find out the table names. Any way I could do this? Link to comment https://forums.phpfreaks.com/topic/5077-determining-field-names/ Share on other sites More sharing options...
wickning1 Posted March 16, 2006 Share Posted March 16, 2006 I've never seen a problem that requires me to add tables dynamically, and I've seen a lot of problems. If you post some more details, we might be able to help you design something a little more stable.However, you can always use SHOW commands to get whatever you need. SHOW DATABASES, SHOW TABLES, SHOW COLUMNS, etc. Link to comment https://forums.phpfreaks.com/topic/5077-determining-field-names/#findComment-18014 Share on other sites More sharing options...
Balmung-San Posted March 17, 2006 Author Share Posted March 17, 2006 I'm creating a shop system that will have different field names for each user. Each user will have a table that is equal to their username.Could I do this?:[code]//connect and select_db$sql = mysql_query("DESCRIBE ".$username);$tables = mysql_fetch_array($sql);[/code] Link to comment https://forums.phpfreaks.com/topic/5077-determining-field-names/#findComment-18347 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.