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
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 ;

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.