PHP& MySQL错误-第176行发生错误:无法将类mysqli_result的对象转换为字符串 [英] PHP & MySQL Error - An error occurred on line 176: Object of class mysqli_result could not be converted to string

查看:72
本文介绍了PHP& MySQL错误-第176行发生错误:无法将类mysqli_result的对象转换为字符串的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道是什么原因导致此错误,如何解决此问题?

I was wondering what is causing this error and how can I correct this problem?

第176行在下面.

$q = "INSERT INTO users (first_name, middle_name, ".
      "last_name, rn, username, month, day, year, se, pic, ".
      "salt, password, rb, aa, ul, rd, ll, ui) ".
      "VALUES ('" . $fn . "', NULL, '" . $ln . "', NULL, '" . 
      $u . "', NULL, NULL, NULL, NULL, NULL, '" . $salt . "', '" . 
      $p . "', '" . $r . "', '" . $ag . "', 0, NOW(), NULL, '" . 
      $unique_id . "')";
$r = mysqli_query ($dbc, $q) or trigger_error("Query: $q\n<br />MySQL Error: " .
         mysqli_error($dbc));

推荐答案

您要向该查询字符串注入的变量之一必须是较早查询的结果.

One of the variables you are injecting into that query string must be a result from an earlier query.

可能是$r.

这篇关于PHP&amp; MySQL错误-第176行发生错误:无法将类mysqli_result的对象转换为字符串的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆