Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Flash AS2 won't load data from mySQL database! (Using PhP, AS2, and MySQL)

Community Beginner ,
Aug 30, 2014 Aug 30, 2014

Hello! I have a problem! Flash CS6 (AS2) won't load up data from mySQL database. It does successfuly send data from flash to phpmyadmin but flash doesn't load it up D:. I need help please!

So the problem is that whenever I test the movie it traces undefined for the variable I want to load from mySQL. Everything is on one frame including the code and textboxes, buttons, etc. Here is my code:

--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

PHP

<?php

require_once('/home/a6934122/public_html/AccountSystem/dbconnect.php');

$testdata1= $_GET['testdata1'];

$testdata2 = $_GET['testdata2'];

$user = $_GET['user'];

$result = mysql_query("SELECT * FROM accounts WHERE user = '$user'");

$result2 = mysql_query("SELECT * FROM accounts WHERE testdata1 = '$testdata1'");

if(mysql_num_rows($result) == 0){

$status = "&Thestatus = PhP Failed.";

echo($status);

} else {

$row2 = mysql_fetch_array($result2);

$row = mysql_fetch_array($result);

$user=$row['user'];

$testdata1=$row2['testdata1'];

$status = "&Thestatus = PhP Successful.";

mysql_query("UPDATE accounts SET testdata1='$testdata1', testdata2='$testdata2' WHERE user='$user'");

echo($status);

}

?>

--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

FLASH AS2

stop();

//Result SendData Code

var result_lv:LoadVars = new LoadVars();

result_lv.onLoad = function(success:Boolean) {

    if (success) {

        result_ta.text = "We are in business.";

    } else {

        result_ta.text = "Error connecting to server.";

    }

}

//Result SendData Code

//Sending Account Data

SendData = new LoadVars();

//Register Account

register = new LoadVars();

registered = new LoadVars();

//Login Account

login = new LoadVars();

logged = new LoadVars();

//Send Datas

SendData.user = user

submitURL = "http://lumosityentertainment.hostei.com/AccountSystem/PhpLoadTest.php";

  SendData.testdata1 = testdata1;

  SendData.testdata2 = "Testing";

trace(SendData.testdata1);

//now the magic

  SendData.sendAndLoad(submitURL, result_lv, "GET");

--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Please help!

TOPICS
ActionScript
774
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Sep 02, 2014 Sep 02, 2014
LATEST

bump

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines