Hi all,
I am having a problem with this. What I have done is had the first query ($queryone) search the table "songs" for items like the search string. Then i have put together the second two queries and added a "while" statement to have the second two queries search the search string used in the first query, plus bring up items that specifically match the itemcodes found in the first query.
I get no error on the mysql, and have echo'ed the query to make sure its doing its work, and it is, but even though there is matching data in the database (over 450 records in each of the two tables) no results are returned.
Anyone have a suggestion?
TIA - Phil
$queryone = "SELECT itemcode FROM songs WHERE itemcode LIKE '%$txt_searchstring%' OR song_name LIKE '%$txt_searchstring%' OR song_artist LIKE '%$txt_searchstring%' OR song_notes LIKE '%$txt_searchstring%' ";
$resultone = mysql_db_query($dbname, $queryone); if(mysql_error()!="") {echo mysql_error(); }
$dbquery_total = "SELECT FROM itemmaster WHERE
itemcode LIKE '%$txt_searchstring%'
OR itemname LIKE '%$txt_searchstring%'
OR itemsubname LIKE '%$txt_searchstring%'
OR itempublisher LIKE '%$txt_searchstring%'
OR itemauthor LIKE '%$txt_searchstring%'
OR itemdescription LIKE '%$txt_searchstring%'";
$dbquery = "SELECT FROM itemmaster WHERE
itemcode LIKE '%$txt_searchstring%'
OR itemname LIKE '%$txt_searchstring%'
OR itemsubname LIKE '%$txt_searchstring%'
OR itempublisher LIKE '%$txt_searchstring%'
OR itemauthor LIKE '%$txt_searchstring%'
OR itemdescription LIKE '%$txt_searchstring%'";
while($firstquery = mysql_fetch_array($resultone)){
$dbquery_total.=" OR itemcode = '$firstquery[itemcode]'";
$dbquery.=" OR itemcode = '$firstquery[itemcode]'";
}
$dbquery.= " limit $StartLimit,$EndLimit";