all groups > flash data integration > april 2006 >
You're in the

flash data integration

group:

flash > php > mySQL update query problem


flash > php > mySQL update query problem kidfunctional
4/20/2006 12:00:00 AM
flash data integration:
Hi all! Bit of an urgent problem. I am trying to update a mySQL database via
flash and PHP where two variables are supplied, a name and a contact ID. I can
pass the variables to the php and check against two variables in the PHP to
check their validity, and I can run the mySQL update query with hardcoded
elements and the database updates. The only problem is when I try to pass the
variables through embeded in the query. Eg. in the PHP the query $query =
"UPDATE contacts SET firstName = 'name' WHERE contactId = '1'"; works but
$query = "UPDATE contacts SET firstName = '$user' WHERE contactId = '$pass'";
doesn't. Apologies for the function code post, but the variables are passed
from Flash using the following code:

function login(user, pass) {
myvars = new LoadVars();
//set variables
myvars.user = user;
myvars.pass = pass;
myvars.onLoad = action;
myvars.sendAndLoad("the processingfile.php?random="+new Date().getTime(),
myvars);
}

Any replies would be greatly appreciated!
Re: flash > php > mySQL update query problem Motion Maker
4/20/2006 11:39:04 AM
Personally I use $_REQUEST['varname'];

ex: $_REQUEST['user];

You can try echo back the variables to Flash but I believe you need two
LoadVars objects with sendAndLoad.

myvarsResponse = new LoadVars
myvarsResponse.onLoad = action;
myvars.sendAndLoad("the processingfile.php?random="+new Date().getTime(),
myvarsResponse);


--
Lon Hosford
www.lonhosford.com
May many happy bits flow your way!
[quoted text, click to view]
Hi all! Bit of an urgent problem. I am trying to update a mySQL database via
flash and PHP where two variables are supplied, a name and a contact ID. I
can
pass the variables to the php and check against two variables in the PHP to
check their validity, and I can run the mySQL update query with hardcoded
elements and the database updates. The only problem is when I try to pass
the
variables through embeded in the query. Eg. in the PHP the query $query =
"UPDATE contacts SET firstName = 'name' WHERE contactId = '1'"; works but
$query = "UPDATE contacts SET firstName = '$user' WHERE contactId =
'$pass'";
doesn't. Apologies for the function code post, but the variables are passed
from Flash using the following code:

function login(user, pass) {
myvars = new LoadVars();
//set variables
myvars.user = user;
myvars.pass = pass;
myvars.onLoad = action;
myvars.sendAndLoad("the processingfile.php?random="+new Date().getTime(),
myvars);
}

Any replies would be greatly appreciated!

AddThis Social Bookmark Button