17.10.2013, 13:03
You can try union select.
If you don't care about duplicates, then do:
PHP код:
$query = mysql_query("(SELECT * FROM `dsb_user_profiles` LIMIT 5) UNION (SELECT * FROM `dsb_user_photo` LIMIT 5) ORDER BY `id` DESC");
while($row = mysql_fetch_assoc($query))
{
$admin = $row['_user'];
$image = $row['photo'];
echo "$admin";
echo "<img src=\"$image\">";
}
PHP код:
$query = mysql_query("(SELECT * FROM `dsb_user_profiles` LIMIT 5) UNION ALL (SELECT * FROM `dsb_user_photo` LIMIT 5) ORDER BY `id` DESC");
while($row = mysql_fetch_assoc($query))
{
$admin = $row['_user'];
$image = $row['photo'];
echo "$admin";
echo "<img src=\"$image\">";
}