I need to pull info from 2 tables using LIKE but also paginate the results.
Table 1: publication
Search by tags
Need ID to search table 2
Table 2: publication_issue
publication_id = publication.id
<?php
$query = ("SELECT *
FROM publication WHERE tags LIKE '%news%'");
$result = mysql_query($query) or die(mysql_error());
while($row = mysql_fetch_array($result)){
$id = $row['id'];
$queryb = ("SELECT *
FROM publication_issue WHERE publication_id = '$id' LIMIT 0, 10");
$resultb = mysql_query($queryb) or die(mysql_error());
while($rowb = mysql_fetch_array($resultb)){
$idb = $rowb[id];
echo "$idb<br />";
} }
?>
This code pulls out everything in the db and doesn't limit the way I want it to. All I need is help to revise this code so that the limit works.
Please help! :-)