Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsGeneralPHPASPPerlColdFusionFlashHTML, CSS, ScriptsBrowsers

Webmaster Forum / Flash / Data Integration / April 2006



Tip: Looking for answers? Try searching our database.

flash > php > mySQL update query problem

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
kidfunctional - 20 Apr 2006 09:53 GMT
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!
Motion Maker - 20 Apr 2006 16:39 GMT
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);

Signature

Lon Hosford
www.lonhosford.com
May many happy bits flow your way!

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!
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.