vmicchia Posted March 11, 2011 Share Posted March 11, 2011 Is there a way to return what table the results came from if you are searching the whole database? my php search would be like this: $query = "select * from * where * like \"%$trimmed%\" "; Thank you for any help Quote Link to comment https://forums.phpfreaks.com/topic/230345-return-table-name/ Share on other sites More sharing options...
Maq Posted March 11, 2011 Share Posted March 11, 2011 Is there a way to return what table the results came from if you are searching the whole database? I'm almost positive that it's invalid to use the '*' wildcard to select every table name. Quote Link to comment https://forums.phpfreaks.com/topic/230345-return-table-name/#findComment-1186205 Share on other sites More sharing options...
vmicchia Posted March 11, 2011 Author Share Posted March 11, 2011 I looked it up and it seemed ok. Perhaps you are right though I will look into it more. Still wondering about the return table name part thought Quote Link to comment https://forums.phpfreaks.com/topic/230345-return-table-name/#findComment-1186212 Share on other sites More sharing options...
PFMaBiSmAd Posted March 11, 2011 Share Posted March 11, 2011 Without listing each table name using a UNION query, there's no way to search through all the tables in a database, so the answer to your question is no, there's no built in way to do this and since you should not be storing same purpose data in separate tables, you should not be wanting to do this anyway. Quote Link to comment https://forums.phpfreaks.com/topic/230345-return-table-name/#findComment-1186232 Share on other sites More sharing options...
vmicchia Posted March 11, 2011 Author Share Posted March 11, 2011 They are product tables for different types of products. Quote Link to comment https://forums.phpfreaks.com/topic/230345-return-table-name/#findComment-1186266 Share on other sites More sharing options...
fenway Posted March 11, 2011 Share Posted March 11, 2011 I looked it up and it seemed ok. Perhaps you are right though I will look into it more. Still wondering about the return table name part thought Then you looked up something else. Quote Link to comment https://forums.phpfreaks.com/topic/230345-return-table-name/#findComment-1186292 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.