Forum Moderators: coopster
I'm running a review database site and I'm displaying links underneath reviews called 'related reviews'. Here's what it's doing:
$relquery = "SELECT id, Band_Name, Record_Name FROM reviews WHERE Band_Name LIKE '%$Band_Name%' AND id NOT LIKE $id ORDER BY Band_Name, Record_Name";
This works fine except in the case of split releases. For example:
Two bands: Xiu Xiu, Devendra Banhart
We have reviews by both artists, and now, a split release they did together. On this record, the $Band_Name value is "Xiu Xiu / Devendra Banhart", so my LIKE search above finds nothing.
I then tried this:
$exploder = explode(' / ', $Band_Name);
$related1 = $exploder[0];
$related2 = $exploder[1];
$relquery = "SELECT id, Band_Name, Record_Name FROM review_test WHERE Band_Name LIKE '%$related1%', '%$related2%' AND id NOT LIKE $id ORDER BY Band_Name, Record_Name";
The above didn't work, so I changed it to search for just:
LIKE '%$related1%'
This then found the Xiu Xiu stuff but not the other artist.
Is there any way I can work around this and somehow search both?
-Matt
Jeff