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? Quote 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. Quote 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] Quote Link to comment https://forums.phpfreaks.com/topic/5077-determining-field-names/#findComment-18347 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.