将MYSQL与wamp和Android Studio连接时出现PHP错误

将MYSQL与wamp和Android Studio连接时出现PHP错误,php,mysql,mysqli,Php,Mysql,Mysqli,我正在尝试使用wamp服务器将我的phpadmin数据库连接到Android Studio,但不幸的是,我的php代码中出现以下错误,并且我尝试使用mysqli而不是mysql。你能帮忙吗 错误日志 错误 <font size='1'><table class='xdebug-error xe-fatal-error' dir='ltr' border='1' cellspacing='0' cellpadding='1'> <tr><t

我正在尝试使用wamp服务器将我的phpadmin数据库连接到Android Studio,但不幸的是,我的php代码中出现以下错误,并且我尝试使用mysqli而不是mysql。你能帮忙吗

错误日志

错误

    <font size='1'><table class='xdebug-error xe-fatal-error' dir='ltr' border='1' cellspacing='0' cellpadding='1'>
    <tr><th align='left' bgcolor='#f57900' colspan="5"><span style='background-color: #cc0000; color: #fce94f; font-size: x-large;'>( ! )</span> Fatal error: Call to undefined method DB_Connect::query() in C:\wamp\www\bradvisor_login_api\include\DB_Functions.php on line <i>67</i></th></tr>
    <tr><th align='left' bgcolor='#e9b96e' colspan='5'>Call Stack</th></tr>
    <tr><th align='center' bgcolor='#eeeeec'>#</th><th align='left' bgcolor='#eeeeec'>Time</th><th align='left' bgcolor='#eeeeec'>Memory</th><th align='left' bgcolor='#eeeeec'>Function</th><th align='left' bgcolor='#eeeeec'>Location</th></tr>
    <tr><td bgcolor='#eeeeec' align='center'>1</td><td bgcolor='#eeeeec' align='center'>0.0010</td><td bgcolor='#eeeeec' align='right'>269136</td><td bgcolor='#eeeeec'>{main}(  )</td><td title='C:\wamp\www\bradvisor_login_api\index.php' bgcolor='#eeeeec'>..\index.php<b>:</b>0</td></tr>
    <tr><td bgcolor='#eeeeec' align='center'>2</td><td bgcolor='#eeeeec' align='center'>0.0894</td><td bgcolor='#eeeeec' align='right'>310872</td><td bgcolor='#eeeeec'>DB_Functions->storeUser(  )</td><td title='C:\wamp\www\bradvisor_login_api\index.php' bgcolor='#eeeeec'>..\index.php<b>:</b>136</td></tr>
    </table></font>
07-17 11:39:17.449    6463-6549/com.bradvisor.bradvisor E/JSON Parser﹕ Error parsing data org.json.JSONException: Value <br of type java.lang.String cannot be converted to JSONObject
07-17 11:39:17.473    6463-6463/com.bradvisor.bradvisor E/AndroidRuntime﹕ FATAL EXCEPTION: main
    Process: com.bradvisor.bradvisor, PID: 6463
    java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String org.json.JSONObject.getString(java.lang.String)' on a null object reference

(!)致命错误:在第67行的C:\wamp\www\bradvisor\u login\u api\include\DB\u Functions.php中调用未定义的方法DB\u Connect::query()
调用堆栈
#时间记忆功能定位
10.0010269136{main}()..\index.php:0
20.0894310872DB_函数->storeUser()..\index.php:136

07-17 11:39:17.449 6463-6549/com.bradvisor.bradvisor E/JSON解析器﹕ 解析数据org.json.JSONException时出错:调用
mysqli.*
函数时,需要传递创建数据库连接时获得的链接/引用(由
mysqli.\u connect(…);
调用返回的对象)

查询调用将类似于:

mysqli_query($link, "SELECT * FROM ...");
就我个人而言,我建议使用OOP风格的
mysqli
,而不是过程性的

   mysqli_query at list Two argument pass 1 is connection string and 2 is query

for Example
$link = mysqli_connect("localhost", "my_user", "my_password", "world");
 if (mysqli_query($link, "CREATE TEMPORARY TABLE myCity LIKE City") === TRUE) {
printf("Table myCity successfully created.\n");

}

mysqli\u query使用两个参数,但您只使用一个,您需要设置$link参数和$query,如下所示:

$link=mysqli_connect(“本地主机”、“我的用户”、“我的密码”、“世界”)

mysqli_查询($link,“创建类似于城市的临时表myCity”)

检查手册:


祝你好运

mysqli\u query()需要至少两个参数,第一个参数在第67行的C:\wamp\www\bradvisor\u login\u api\include\DB\u Functions.php中给出。请给出建议。您能帮忙吗,第67行是$result=mysqli\u query(“插入到用户中(唯一的\u id、firstname、lastname、电子邮件、用户名、加密的\u密码、salt、创建的\u at)”值(“$uuid”、“$fname”、“$lname”、“$email”、“$uname”、“$encrypted_password”、“$salt”,NOW()”);不。请不要在此处要求他人为您编写代码。如果您需要有人为您编写代码,我建议您聘请他人来编写。
   mysqli_query at list Two argument pass 1 is connection string and 2 is query

for Example
$link = mysqli_connect("localhost", "my_user", "my_password", "world");
 if (mysqli_query($link, "CREATE TEMPORARY TABLE myCity LIKE City") === TRUE) {
printf("Table myCity successfully created.\n");