Hi there,
i searched a while with no solution found for the problem.
I try to pass an argument for the database name to the php main method like this:
PHP Code:
var $conn;
var $database;
function protokoll_service() {
$this->methodTable....
.
.
$this->conn = new Connection("123.23...", $dbname, "user", "pass");
}
function setDatabase($param) {
if ($param != "") {
$this->database = $param;
}
}
function xyz.....
So if create the remote object in flex and call setDatabase with given
database name the connection is not established with given db name.
Here is the flex piece
Code:
private function sendRemoteObject(source:String, call:String, resulthandler:Function, faulthandler:Function, obj:Object = null):void {
var channel:Channel = new AMFChannel(null, "http://localhost/protokoll/gateway.php");
var chSet:ChannelSet = new ChannelSet();
chSet.addChannel(channel);
remote = new RemoteObject();
remote.destination="empService";
remote.source = source;
remote.channelSet = chSet;
//Test
remote.setDatabase("test");
//var db:Object = new Object();
//db.name = "test";
//remote.setDatabase(db);
//Testend
var op:mx.rpc.AbstractOperation = remote[call]; //works fine
var service:AsyncToken;
if(obj != null){
service = op.send(obj);
}
else{
service = op.send();
}
service.addResponder(new mx.rpc.Responder(resulthandler, faulthandler));
}
The variable is passed to php but the connection is not established with the given db name. with name hardcoded it works but im not flexible 
IŽd like to use this for testeing purposes. If the user start air app with test parameter amfphp should use database with name "test" otherwise it should use default db...
Any help would be great 
Thx
Ingo
Bookmarks