
get-news.php
By:
FamiHug on
May 27th, 2012 | syntax:
PHP | size: 0.49 KB | hits: 26 | expires: Never
<?php
require_once 'config.php';
startMySQLConnection();
$sql = "SELECT n.id AS id,n.name AS name,n.summary AS summary,p.image AS image,n.creationDate AS creationDate
FROM news n
INNER JOIN leagues l ON n.leagueId=l.id
INNER JOIN photos p ON n.leagueId=p.leagueId
WHERE n.leagueId=" . $_REQUEST['leagueId'];
$query = mysql_query($sql);
while ($row = mysql_fetch_array($query)) {
$row["image"] = prefixFullUrl($row, "image");
$output[] = $row;
}
print json_encode($output);
?>