Skip to content

Instantly share code, notes, and snippets.

@Bueloha
Created February 26, 2013 14:29
Show Gist options
  • Save Bueloha/5038809 to your computer and use it in GitHub Desktop.
Save Bueloha/5038809 to your computer and use it in GitHub Desktop.
/* TASK 2 ARTICLE CLUSTERING */
<?php
session_start();
$_SESSION['title']='$title';
?>
<?php
include('lib/connect.php');
$sql = "SELECT * FROM eliseo_exam_table where title like $_SESSION['title'] LIMIT 10";
$result = mysql_query($sql);
while($row = mysql_fetch_array($result))
{
$rows[] = array(
"publish" => $row['publish'],
"content" => $row['content'],
"source_url" => $row['source_url'],
"author" => $row['author'],
"title" => $row['title']);
}
$json = json_encode($rows);
$callback = $_GET['callback'];
echo $callback.'('. $json . ')';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment