<?php
class ShowComments {
// constructor
function ShowComments () {
$this->methodTable = array(
"displayComments" => array(
"description" => "Return array of comment information",
"access" => "remote"
)
);
}
// method called from flash
function displayComments() {
// This will make the connection to your database
include('sql.php');
// query to your database
$query = "SELECT name, comment, DATE_FORMAT(commenttime,'%r on %W, %M %D %Y') FROM commentbox";
$result = mysql_query($query) or die("Query failed : " . mysql_error());
$rows = array();
while ($row = @mysql_fetch_array($result, MYSQL_NUM)) {
$rows[] = $row;
}
return $rows;
mysql_close();
}
}
?>