I'm trying to learn some AMFPHP, no problem with that. And i've been using PHP every now and then.. OOP is new for me, so here is the function to save data to DB:
PHP Code:
public function save($data)
{
$this->connect();
$data = $data->data;
$data = mysql_real_escape_string($data);
$query = "INSERT INTO $this->table (`data`) VALUES ('$data');";
$result = mysql_query($query);
$error = mysql_error();
$recnum = mysql_insert_id();
mysql_close();
if ($error)
return "error: " . $error;
else
return $recnum;
}
I need to modify that to receive more args, like this:
PHP Code:
public function save($pid,$cid,$action,$data)
So this one is not clear for me:
PHP Code:
$data = $data->data;
I believe thats OOP thing

..but do i need to do that for all args that im sending to this function? With "classic" php it was not necessary.
Actually, now when i wrote this, i might have an idea:
$data variable is coming from flashApp, and here is the code for that from flash:
Code:
var byteArray:ByteArray = new ByteArray();
byteArray.writeObject(data);
byteArray.compress();
And now im thinking ..something like.. $data variable is actually object that contains data variable? And $data->data gets that data variable, right?