flash > php > mySQL update query problem

Ask a Question related to Macromedia Flash Data Integration, Design and Development.

  1. #1

    Default flash > php > mySQL update query problem

    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!

    kidfunctional Guest

  2. Similar Questions and Discussions

    1. Problem with Dynamic Update Query
      I am having a problem with a dynamic query I create a string which will be inserted into the Query tag <cfQuery> Update Table Set #MyVar#...
    2. MySQL Query Problem
      :confused; What is wrong with the following Query? It's in the book, but not working. Select OrderID, OrderDate, (SELECT Count (*) From...
    3. Flash - PHP - mySQL - update databse records problem
      Hi i am having troubnle getting flash to update existing databse records. I can get it to add new records and view existing records buit cant get it...
    4. php & mysql update problem
      Dear news-team I'm using MySQL 4.0.15a (with PHP 4.3.4rc1 and Apache 2.0.47 under FreeBSD). I'm having problems when updating a column of a...
    5. Problem with MySQL Query
      Problem with mySQL Query This is the query I have: $dbqueryshipping1 = "select * from tempuserpurchase where...
  3. #2

    Default Re: flash > php > mySQL update query problem

    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
    [url]www.lonhosford.com[/url]
    May many happy bits flow your way!
    "kidfunctional" <webforumsuser@macromedia.com> wrote in message
    news:e27i6a$e14$1@forums.macromedia.com...
    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 Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139