$query = "SELECT * FROM asset_notebookmaster " ."WHERE asset_notebookmaster.notebook_user LIKE '%".$keywords[$i]."%'"." OR asset_notebookmaster.notebook_description LIKE '%".$keywords[$i]."%'"." UNION
"SELECT * FROM asset_cablelock " ."WHERE asset_cablelock.staffname LIKE '%".$keywords[$i]."%'"." ORDER BY notebook_assetid";
}
//Store the results in a variable or die if query fails
$result = mysql_query($query) or die(mysql_error());
}
Code: Select all
} else {
//Count the rows retrived
$count = mysql_num_rows($result);
}
Hi, can anyone show me how to search two table. The thing is, both asset_notebookmaster and asset_cablelock has a user field. Not all users are identical though. I am having a T string error. is this way to search two tables