Jump to content

Need help with search database query..


Scooby08

Recommended Posts

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%\" ";
?>

Link to comment
https://forums.phpfreaks.com/topic/143369-need-help-with-search-database-query/
Share on other sites

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 ;

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.