how do i limit each of the or from this mysql sequence =
$sexy = 'sexy';
$new = 'new';
$something = 'something';
$brand = 'brand';
$one = 'one';
$limit = 12;
$query = "SELECT `videoname`,`username`,`videourl`,`uploaddate`,`duration`,`views`,`tags`,`videoimage` FROM `videolist` WHERE `tags` = ? OR `tags` = ? OR `tags` = ? OR `tags` = ? OR `tags` = ? ";
$stmt = $connection->prepare($query);
$stmt->bind_param('sssss',$sexy,$new,$something,$brand,$one);
//$stmt->bindValue(":limitz",4,PDO::PARAM_INT);
//$stmt->bindValue(":isi",1,PDO::PARAM_INT);
$stmt->execute();
$stmt->store_result();
if($stmt->num_rows > 0){
$stmt->bind_result($videoname,$username,$videourl,$uploaddate,$duration,$views,$tags,$videoimage);
while ($stmt->fetch())
{
if($tags == $sexy){
$descBox = $doc->getElementById('suggested-video');
//create the element to append to #element1
$appended = $doc->createElement('li', "
<a href='video.php?watch=$videourl'>
<div class='leftside'>
<img src='image/$videoimage' width='100%' height='100%' style='background-color: blue;' >
</div>
<div class='rightside'>
<h4>$videoname</h4>
<p>$username</p>
<p>$views views</p>
<p>$duration</p>
</div>
</a>
");
//actually append the element
$descBox->appendChild($appended);
}// end of suggested-video
if($tags == $new){
$descBox = $doc->getElementById('popular-video');
//create the element to append to #element1
$appended = $doc->createElement('li', "
<a href='video.php?watch=$videourl'>
<div class='leftside'>
<img src='image/$videoimage' width='100%' height='100%' style='background-color: blue;' >
</div>
<div class='rightside'>
<h4>$videoname</h4>
<p>$username</p>
<p>$views views</p>
<p>$duration</p>
</div>
</a>
");
//actually append the element
$descBox->appendChild($appended);
}// end of popular-video
if($tags == $something){
$descBox = $doc->getElementById('subcription-video');
//create the element to append to #element1
$appended = $doc->createElement('li', "
<a href='video.php?watch=$videourl'>
<div class='leftside'>
<img src='image/$videoimage' width='100%' height='100%' style='background-color: blue;' >
</div>
<div class='rightside'>
<h4>$videoname</h4>
<p>$username</p>
<p>$views views</p>
<p>$duration</p>
</div>
</a>
");
//actually append the element
$descBox->appendChild($appended);
}// end of popular-video
i need it so each tags
have a limit to fetch no more than 6. is it possible? if not is there a way to limit it in php?. here is the whole code. basically the code above asking if tags
is equal to either of the 5 tags at the top it will be fetched. and there are more than 6 videos/ column on each tags but i only want each tag to only fetch no more than 6.