Reply to comment

Dates

Hi Andrew, thanks for writing this post. Could you possibly take a few moment to write the code needed to send the data back to flex from the MySQL object? Maybe you could alter my script below to demonstrate, sorry but I've been banging my head against a wall for three days trying to get this to work.

Here is my php script:


require_once './VOTrailer.php'; //my VO

public function getTrailers(){
$result = mysql_query('select * from trailer where company_id = 1');

$ret = array();
while ($row = mysql_fetch_object($result)) {
$tmp = new VOTrailer();

$tmp->id = $row->id;
$tmp->adr = $row->adr;
$tmp->label = $row->label;
$tmp->type = $row->type;
$tmp->loc_street = $row->loc_street;
$tmp->loc_city = $row->loc_city;
$tmp->loc_country = $row->loc_country;
$tmp->dest_street = $row->dest_street;
$tmp->dest_city = $row->dest_city;
$tmp->dest_country = $row->dest_country;
$tmp->start_date = $row->start_date;
$tmp->end_date = $row->end_date;
$tmp->space = $row->space;
$tmp->description = $row->description;
$tmp->notes = $row->notes;
$tmp->timestamp = $row->timestamp;
$tmp->company_id = $row->company_id;
$ret[] = $tmp;
}
mysql_free_result($result);
return $ret;
}

Reply

  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

More information about formatting options