4
Contributors
3
Replies
4
Views
5 Years
Discussion Span
Last Post by diafol
0

Are the two tables somehow related? If yes you can JOIN them and search for both terms. Without knowing the structure of the tables it is hard to tell more.

0

you can also use UNION but as broj1 said without knowing the structure of your table its hard to tell..geez i just repeat what broj1 said..anyway you can use either of this..

Edited by ehpratah

1

The UNION structure should see you right:

$search = '%' . mysql_real_escape_string($searchname) . '%';
$result = mysql_query("(SELECT name AS searchout FROM name_search WHERE name LIKE '$search') UNION (SELECT skill AS searchout FROM skill_srch WHERE name LIKE '$search')");

I think. The UNION requires identical fieldnames in both queries.

Edited by diafol

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.