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 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. 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 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. 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. 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. Link to comment https://forums.phpfreaks.com/topic/230345-return-table-name/#findComment-1186292 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.