Hello,I cant access my two table date together in one search option.like table name: name_search & skill_search.here is the code.please check it and if possible solve it.
<?php
$connect=mysql_connect('localhost','root','');
$mysql_db=mysql_select_db('my_database',$connect) or die(mysql_error());
if (isset($_POST['search_name']) && isset($_POST['search_skill']))
{
$search_name= $_POST['search_name'];
$search_skill= $_POST['search_skill'];
if(!empty($search_name) && !empty($search_skill)){
if(strlen($search_name,$search_skill)>=4){
$query = "SELECT name FROM name_search WHERE name LIKE '%".mysql_real_escape_string($search_name)."%'" AND "SELECT skill FROM skill_srch WHERE name LIKE '%".mysql_real_escape_string($search_skill)."%'" ; // table name: name_search and skill_srch //
$query_run= mysql_query($query);
$query_num_rows=mysql_num_rows($query_run);
if($query_num_rows>=1)
{
echo $query_num_rows.' Result Found:<br/>';
while ($query_row=mysql_fetch_assoc($query_run)){
echo $query_row['name'].'<br/>';
}
}
else
{
echo 'Not found';
}
}
else {
echo 'Please Character must be more then 5 keywords';
}
}
}
?>
<form action="<?php $current_file; ?> "method="POST">
<input type="test" name="search_name">
<input type="submit" value="search">
</form>