Advertisement
FamiHug

get-news.php

May 27th, 2012
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.49 KB | None | 0 0
  1. <?php
  2.  
  3. require_once 'config.php';
  4. startMySQLConnection();
  5.  
  6. $sql = "SELECT n.id AS id,n.name AS name,n.summary AS summary,p.image AS image,n.creationDate AS creationDate
  7. FROM news n
  8. INNER JOIN leagues l ON n.leagueId=l.id
  9. INNER JOIN photos p ON n.leagueId=p.leagueId
  10. WHERE n.leagueId=" . $_REQUEST['leagueId'];
  11.  
  12. $query = mysql_query($sql);
  13. while ($row = mysql_fetch_array($query)) {
  14.     $row["image"] = prefixFullUrl($row, "image");
  15.     $output[] = $row;
  16. }
  17.  
  18. print json_encode($output);
  19. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement