Code: Select all
<?//Load News
$query1 = "SELECT * FROM `remnants` WHERE type='update' LIMIT 5";
$query2 = "SELECT * FROM `jayeffcomnews` WHERE type='update' LIMIT 5";
$result = mysql_query($query1);
$rows1 = mysql_fetch_array($result);
$result = mysql_query($query2);
$rows2 = mysql_fetch_array($result);
$rows = array_merge($rows1,$rows2);
//Sort $rows array
function BypgID($left, $right) {
return ($right[pgid] - $left[pgid]);
}
usort($rows, "MypgID");
//Print
foreach ($rows as $row) {
$poster = $row[sub];
$time = $row[pgid];
$time = gmdate("F d, Y h\:i A",$time-18000);
$title = $row[pgtitle];
$update = $row[page];
$result2= mysql_query("SELECT * FROM `smilies` WHERE kind = 'user'");
while($mrow = MYSQL_FETCH_ARRAY($result2)){
$scode = $mrow["code"];
$url = $mrow["url"];
$update= ereg_replace("$scode", "<img src="http://www.jay-eff.com/$url">", $update);
$update= eregi_replace(":<", '<', $update);
$update= eregi_replace(">:", '>', $update);
}
$update = ereg_replace("\n","<br />", $update);
?>
<b><? echo $time ?> - <? echo $title ?> (Poster by <a href="?who-<? echo $poster ?>"><? echo $poster ?></a>)</b><br />
<? echo $update ?><br /><br />
<?
}?>Please help me with this without just showing me the manual page for it, I have looked through enough of php.net's manual to realize that I don't understand what they are saying. Just tell me what is wrong with my code.
Thank you in advance.
PS: I am running version 3 of mySQL, so giving me the UNION function doesn't work.