RopeADope Posted February 18, 2011 Share Posted February 18, 2011 Hi all. The title pretty much says it all. I really have no idea if this is even possible or where to start. A recent dilemma caused me to have to change a field name with some spaces in it. I have a database with ~65 tables, a majority of which were converted from Access. So I'm curious as to how many others have bad field names. Is there a way to use PHP to go through all the field names in a database and remove spaces? Quote Link to comment Share on other sites More sharing options...
BlueSkyIS Posted February 18, 2011 Share Posted February 18, 2011 Is there a way to use PHP to go through all the field names in a database and remove spaces? yes. you can use SQL to get the column names of each table, then look for spaces in those column names. if spaces are found, remove or replace the space in the field name, then MODIFY TABLE to change the field name from the old name to the new name. Quote Link to comment 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.