PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
<?php
mysql_query("CREATE VIEW F1LIMIT5 as SELECT DISTINCT albumid from tags WHERE id3='$value' AND flag!='w' AND visibility='t' ORDER BY datetimep DESC limit 5");
$aresult=mysql_query("SELECT * from tags where albumid in (SELECT * FROM F1LIMIT5) and id3='$value' AND flag!='w' AND visibility='t' order by datetimep desc");
?>
I would need not to use the create view query, and instead make it a single query, substitute the select * from f1limit5
<?php
$aresult=mysql_query("SELECT * from tags where albumid in (DISTINCT albumid from tags WHERE id3='$valued' AND flag!='w' AND visibility='t' ORDER BY datetimep DESC limit 5) and id3='$value' AND flag!='w' AND visibility='t' order by datetimep desc");
?>
Returns php errors, I really want to get rid of the view.
$aresult = mysql_query(sprintf("SELECT * FROM tags WHERE id3='%s' AND flag!='w' AND visibility='t' ORDER BY datetimep DESC", mysql_real_escape_string($value)));