Scooby08 Posted February 1, 2009 Share Posted February 1, 2009 I can't seem to get this bit to work.. I'm not getting any errors either.. Any recommendations?? <?php $query = "SELECT one.name, one.symbol, two.name, two.symbol, three.name, three.symbol "; $query .= "FROM one, two, three "; $query .= "WHERE one.name LIKE \"%$find_symbol%\" "; $query .= "OR two.name LIKE \"%$find_symbol%\" "; $query .= "OR three.name LIKE \"%$find_symbol%\" "; ?> Quote Link to comment https://forums.phpfreaks.com/topic/143369-need-help-with-search-database-query/ Share on other sites More sharing options...
Snart Posted February 1, 2009 Share Posted February 1, 2009 What is the purpose of the query, what are the contents of the tables, and which result do you see from this query? Quote Link to comment https://forums.phpfreaks.com/topic/143369-need-help-with-search-database-query/#findComment-751924 Share on other sites More sharing options...
Scooby08 Posted February 1, 2009 Author Share Posted February 1, 2009 The purpose is to search 3 tables in 2 specific fields from each.. Table one, two, three and each table has fields name, symbol.. I see nothing when I run the code.. All 3 tables are like so: CREATE TABLE `one` ( `id` int(10) unsigned NOT NULL auto_increment, `name` varchar(255) NOT NULL default '', `symbol` varchar(20) NOT NULL default '', `market_value` varchar(20) NOT NULL default '', `description` text NOT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ; Quote Link to comment https://forums.phpfreaks.com/topic/143369-need-help-with-search-database-query/#findComment-751927 Share on other sites More sharing options...
fenway Posted February 3, 2009 Share Posted February 3, 2009 Yikes! I think you mean UNION. Quote Link to comment https://forums.phpfreaks.com/topic/143369-need-help-with-search-database-query/#findComment-753345 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.