MySQL、PhP和Flash As3数据加载不正确?
由于某些原因,PHP变量的加载非常不正确。这就是发生的情况: 在我的PHP代码中,我有:MySQL、PhP和Flash As3数据加载不正确?,php,mysql,actionscript-3,flash,loading,Php,Mysql,Actionscript 3,Flash,Loading,由于某些原因,PHP变量的加载非常不正确。这就是发生的情况: 在我的PHP代码中,我有: <?php include_once "connect.php"; $username = $_POST['username']; $password = $_POST['password']; if ($_POST['systemCall'] == "checkLogin") { $sql = "SELECT * FROM users WHERE username='$username
<?php
include_once "connect.php";
$username = $_POST['username'];
$password = $_POST['password'];
if ($_POST['systemCall'] == "checkLogin") {
$sql = "SELECT * FROM users WHERE username='$username' AND password='$password'";
$query = mysql_query($sql);
$login_counter = mysql_num_rows($query);
if ($login_counter > 0) {
while ($data = mysql_fetch_array($query)) {
$testing = $data["testing"];
$userbio = $data["user_bio"];
print "thetesting=$testing";
print "theuserbio=$userbio";
}
} else {
print "theuserbio=The login details dont match our records.";
}
}
?>
import flash.text.*;
result_text.autoSize = TextFieldAutoSize.LEFT;
result_text.text = "" + event.target.data.theuserbio;
result_text2.text = "" + event.target.data.thetesting
发生的情况是,每当我使用正确的凭据登录时,result\u text.text
将显示undefined
但是result\u text2.text
会说:hellotheurberbio=这是用户bio
基本上,所发生的是结果\u text2
同时表示userbio
和testing
。而result\u text
表示undefined
如何使
result\u text
显示userbio
中的数据,而result\u text 2
显示测试
中的数据?在打印之间添加符号
print "thetesting=$testing";
print "&";
print "theuserbio=$userbio";
并检查您是否有此行:
urlloader.dataFormat = URLLoaderDataFormat.VARIABLES;
请在这里内联发布您的PHP代码。并缩进它。您的PHP看起来很容易受到SQL注入攻击,仅供参考。谢谢Aaron,但我现在并不介意,我正在尝试让它工作。我在这里添加了PHP代码。