Forum Moderators: coopster
Basically I have a situation where I need to prefix any table name in a query with a string. All of my queries are passed into a class, so I can do whatever I want with the query before actually running the query. At first it seemed like a simple matter because I could simply do this:
eregi_replace("into ", "into $table_prefix", $query);
eregi_replace("from ", "from $table_prefix", $query);
etc.
But then what if we insert into the database and one of the field values contains "into". Also what about select queries that take fields from multiple tables. For example:
select some stuff from tableA hello, tableB hi, tableC anothername
So my question is is there a function that will list out all of the tables being used in a query? Or is there any way to write my own function for that?
Thanks a ton for your help. I really apprecaite it.