将数据从网站传递到android

时间:2014-01-19 22:25:44

标签: php android

这是我的问题,我怎么能把变量从android传递到PHP?请帮帮我..这是我的问题。

Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /home/a3701630/public_html/getDesc.php on line 9

这是我的PHP代码。

<?php
    include 'config.php';
    connect();

    $userid= str_replace('_', ' ', mysql_escape_string($_POST['userid']));
    $sql = "SELECT description FROM tbl_userdescription WHERE userid = ". $userid;
    $result = mysql_query($sql); 

    while($row=mysql_fetch_assoc($result))
        $output[]=$row;

    print(json_encode($output));
?>

0 个答案:

没有答案