Professional Web Applications Themes

Flash - PHP - mySQL - update databse records problem - Adobe Flash, Flex & Director

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 to update existing records. i have included the code im using. I would really appreciate it if any one can help me as this is for my uni project due in in 2 weeks and really need to get it working. thanks. the code __________________________________________________ ______________________________ ____ username text box var in flash - username password text box var in flash - pass submit button in flash - on (release) { loadVariables("update.php", ...

  1. #1

    Default 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 to update
    existing records. i have included the code im using. I would really appreciate
    it if any one can help me as this is for my uni project due in in 2 weeks and
    really need to get it working.

    thanks.

    the code

    __________________________________________________ ______________________________
    ____

    username text box var in flash - username

    password text box var in flash - pass

    submit button in flash -

    on (release) {
    loadVariables("update.php", 0, "POST");
    }



    all help appreciated.

    include.inc
    _______________

    <?

    #Edit these variable names to reflect Yours.

    $DBhost = "localhost";
    $DBuser = "barry";
    $DBpass = "gee";
    $DBName = "uploadthis";
    $table = "info";

    ?>


    update.php
    _______________

    <?
    include ('Include.inc');

    mysql_connect($DBhost,$DBuser,$DBpass);
    mysql_select_db("$DBName");

    $query = "UPDATE $table SET Password = '$pass' WHERE User = 'username'";
    $result = mysql_query($query);

    ?>

    ++Barry++ Guest

  2. #2

    Default Re: Flash - PHP - mySQL - update databse records problem

    In update.php: where are you catching the variables from flash? So, like this
    $pass = $HTTP_POST_VARS['pass'];
    $username = $HTTP_POST_VARS['username'];
    In Flash:
    loadVariables("update.php?username=" + username + "&pass=" + pass, 0, "POST");
    Question remains: what are you returning to Flash from update.php

    LuigiL Guest

  3. #3

    Default Re: Flash - PHP - mySQL - update databse records problem

    $query = "UPDATE $table SET Password = '$pass' WHERE User = 'username'";

    should be $username at the end of the line (you missed the $)
    perry

    "++Barry++" <webforumsusermacromedia.com> schrieb im Newsbeitrag
    news:d5t01m$htd$1forums.macromedia.com...
    > 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 to
    update
    > existing records. i have included the code im using. I would really
    appreciate
    > it if any one can help me as this is for my uni project due in in 2 weeks
    and
    > really need to get it working.
    >
    > thanks.
    >
    > the code
    >
    >
    __________________________________________________ __________________________
    ____
    > ____
    >
    > username text box var in flash - username
    >
    > password text box var in flash - pass
    >
    > submit button in flash -
    >
    > on (release) {
    > loadVariables("update.php", 0, "POST");
    > }
    >
    >
    >
    > all help appreciated.
    >
    > include.inc
    > _______________
    >
    > <?
    >
    > #Edit these variable names to reflect Yours.
    >
    > $DBhost = "localhost";
    > $DBuser = "barry";
    > $DBpass = "gee";
    > $DBName = "uploadthis";
    > $table = "info";
    >
    > ?>
    >
    >
    > update.php
    > _______________
    >
    > <?
    > include ('Include.inc');
    >
    > mysql_connect($DBhost,$DBuser,$DBpass);
    > mysql_select_db("$DBName");
    >
    > $query = "UPDATE $table SET Password = '$pass' WHERE User = 'username'";
    > $result = mysql_query($query);
    >
    > ?>
    >

    perry Guest

  4. #4

    Default Re: Flash - PHP - mySQL - update databse records problem

    Hi, thanks for your comments. i have tried both methods and still cant get it
    to work. i now have ....

    include.inc
    _______________

    <?

    $DBhost = "localhost";
    $DBuser = "barry";
    $DBpass = "gee";
    $DBName = "uploadthis";
    $table = "info";

    ?>

    update.php
    _______________

    <?
    include ('Include.inc');

    mysql_connect($DBhost,$DBuser,$DBpass);
    mysql_select_db("$DBName");

    $pass = $HTTP_POST_VARS['pass'];
    $username = $HTTP_POST_VARS['username'];

    $query = "UPDATE $table SET Password = '$pass' WHERE User = '$username'";
    $result = mysql_query($query);

    ?>


    and in flash .....

    username text box var in flash - username

    password text box var in flash - pass

    submit button in flash -

    loadVariables("update.php?username=" + username + "&pass=" + pass, 0, "POST");

    Any help welcome.

    Thanks.



    ++Barry++ Guest

  5. #5

    Default Re: Flash - PHP - mySQL - update databse records problem

    Try
    $query = "UPDATE '$table' SET Password = '$pass' WHERE User = '$username'";
    LuigiL Guest

  6. #6

    Default Re: Flash - PHP - mySQL - update databse records problem

    I really dont knpow whats going on but i still cant get it working. I have
    tried all of the above yet still cant get it to work. Im running out of time so
    any other help is very welcome. Thanks for the previous posts.



    ++Barry++ Guest

  7. #7

    Default Re: Flash - PHP - mySQL - update databse records problem

    Post you fla and all code and I will have a look at it.
    LuigiL Guest

  8. #8

    Default Re: Flash - PHP - mySQL - update databse records problem

    I have a sample application where i am passing values to PHP.
    $table = $HTTP_POST_VARS['tab'];

    this does not carry the value from the flash. I used the POST method in Flash.

    Can you HELP?
    Lakslavan Guest

Similar Threads

  1. flash > php > mySQL update query problem
    By kidfunctional in forum Macromedia Flash Data Integration
    Replies: 1
    Last Post: April 20th, 03:39 PM
  2. Update Dates from Flash into MySQL Dbase
    By Kryss2099 in forum Macromedia Flash Data Integration
    Replies: 3
    Last Post: February 27th, 01:25 PM
  3. Update multiple records and fields problem
    By J.D. Buehls in forum ASP Database
    Replies: 5
    Last Post: February 6th, 01:27 AM
  4. php & mysql update problem
    By Harald Servat Gelabert in forum PHP Development
    Replies: 2
    Last Post: November 21st, 05:19 PM
  5. Replies: 2
    Last Post: August 22nd, 09:37 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not 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