gpt4 book ai didi

php - Flash AS2 不会从 mySQL 数据库加载数据! (使用 PhP、AS2 和 MySQL)

转载 作者:行者123 更新时间:2023-11-29 12:44:54 25 4
gpt4 key购买 nike

我有一个问题! Flash CS6 (AS2) 不会从 mySQL 数据库加载数据。它确实成功地将数据从 flash 发送到 phpmyadmin,但 flash 没有将其加载到 D: 上。我需要帮助!所以问题是,每当我测试电影时,它都会跟踪我想要从 mySQL 加载的变量的未定义情况。所有内容都在一个框架上,包括代码和文本框、按钮等。这是我的代码:

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");

最佳答案

加载变量的标准方式是为loadvars对象编写so onload事件

试试这个:

var result_lv:LoadVars = new LoadVars();
SendData.user = user;
submitURL = "http://lumosityentertainment.hostei.com/AccountSystem/PhpLoadTest.php";
result_lv.testdata1 = testdata1;
result_lv.testdata2 = "Testing";
result_lv.onLoad = function(success:Boolean) {
if (success) {
result_ta.text = "We are in business.";
} else {
result_ta.text = "Error connecting to server.";
}

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

您可以在这里找到有用的信息:loadvar as2 help

关于php - Flash AS2 不会从 mySQL 数据库加载数据! (使用 PhP、AS2 和 MySQL),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25593204/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com