[英]How can i send a String from AS3 to a PHP file so it can be use to do a database query
[英]How do I query a mysql database for a file in php and then send the response?
我想让 PHP 在 mysql 表中查找文档,然后发送 http 响应。 该响应稍后将在 iPad 应用程序中使用。 我从这个 PHP 对我的应用程序的唯一响应是:<>
没有帮助...有什么想法吗? 非常感谢!
<?
$username=$_GET['user'];
$password=$_GET['secret'];
$database="db";
mysql_connect(localhost,$username,$password);
@mysql_select_db($database) or die("Unable to select database");
$sql = "SELECT * FROM documents WHERE documentId='2'";
$result = mysql_query($sql);
dataT = @mysql_result($result, 0, "Document");
$name = @mysql_result($result, 0, "DocumentTitle");
$size = @mysql_result($result, 0, "DocumentSize");
$type = @mysql_result($result, 0, "DocumentType");
header("Content-type: $type");
header("Content-length: $size");
header("Content-Disposition: attachment; filename=$name");
header("Content-Description: PHP Generated Data");
header("Content-transfer-encoding: binary");
echo $dataT;
mysql_close();
?>
前面有个$
dataT = @mysql_result($result, 0, "Document");
失踪。
请激活所有错误报告,即E_NOTICE
- 然后您将自己和及早看到此类错误。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.