<?php
// Wade Arnold: 1/16/2008
// Example is designed to show how to use datagrid.
class DataGrid {
var $aRoster;
public function __construct() {
$aRoster = array()
$connection = mysql_connect("localhost","ben","private");
if(!connection)
{
die("Database Connection Failed: " . mysql.error());
}
$db_select = mysql_select_db("private",$connection);
if(!$db_select)
{
die("Database Selection Failed: " . mysql.error());
}
$query = "SELECT * FROM thought, user WHERE thought.email=user.email AND isValid=1";
$result = mysql_query($query);
$i = 0;
while($row = mysql_fetch_assoc($result))
{
$first = $row['first_name'];
$last = substr($row['last_name'],0,1);
$city = $row['city'];
$state = $row['state'];
$thought = $row['thought'];
$time = date("F j, Y, g:i a",$row['creationDate']);
$direction = "";
$aRoster[$i] = array( Name =>"$first $last.",
City => "$city, $state",
Time => "$time",
Thought => "$thought");
$i++;
}
}
public function getDataSet() {
return $this->aRoster;
}
}
?>
I’m trying to use amfphp and can’t figure out why this MSQL request doesn’t work. How do I properly structure an array dynamically to be used with AMFPHP.