it's tough - i can't use JOIN because there are WHERE qualifications each query needs to fit separately. I also want to order it all by the date DESC (post_date and comment_date).
$posts = mysql_query("SELECT * FROM tb1 WHERE (`feild1` LIKE $a) OR (`feild1` LIKE $b AND `feild2` LIKE 'o%' OR `feild2` LIKE 'c%' OR `feild2` LIKE 'p%') OR (`feild1` LIKE $c AND `feild2` LIKE 'o%' OR `feild2` LIKE 'c%') ORDER BY post_date DESC LIMIT 0, 5") or die(mysql_error());
$comments = mysql_query("SELECT * FROM tbl2 WHERE `feildA` LIKE '$1' ORDER BY comment_date DESC LIMIT 0, 5") or die(mysql_error());
OR maybe you can show me how to put qualifications on this query using a JOIN method:
$result = mysql_query("SELECT tbl1.*, tbl2.*, tbl3.feild1, tbl3.feild2 FROM tbl1, tbl2, tb3 ORDER BY tbl1.post_date,tbl2.comment_date,tbl3.st... DESC LIMIT 0,15") or die(mysql_error());
Tags: