douting1871 2015-11-18 03:32
浏览 264

mysqli类的对象无法转换为字符串

My problem isn't the same as the other questions, I use a dramatically different code which I'm not sure how to deal with or how to apply solutions of others' codes to mine.

I am getting the error

Object of class mysqli could not be converted to string in

This is the part where my code has problems

    <?php
function aggiornamento($utente){
global $conn;
global $_CONFIG;
           $selezione=mysqli_query($conn, "SELECT * FROM ".$_CONFIG['db_account'].".account WHERE login = '".$utente."' LIMIT 1");
           while ($account = mysqli_fetch_array($selezione))
           {
    $_SESSION['IShop_Login']= $account['login'];
           }
} ?>

Whereas line 5 is the "faulty" line

  • 写回答

3条回答 默认 最新

  • duandong2562 2015-11-18 03:40
    关注

    you can use like

    $conn=mysqli_connect($host,$username,$password,$dbname);
    

    try to connect first with you db and then use it like

    $selezione=mysqli_query($conn, "SELECT * FROM ".$_CONFIG['db_account'].".account WHERE login = '".$utente."' LIMIT 1");
               while ($account = mysqli_fetch_array($selezione))
    

    you can refer link

    http://php.net/manual/en/mysqli.query.php

    we have procedural style of mysqli_query

    Hope this solves your query

    评论

报告相同问题?

悬赏问题

  • ¥15 神经网络预测均方误差很小 但是图像上看着差别太大
  • ¥15 Oracle中如何从clob类型截取特定字符串后面的字符
  • ¥15 想通过pywinauto自动电机应用程序按钮,但是找不到应用程序按钮信息
  • ¥15 如何在炒股软件中,爬到我想看的日k线
  • ¥15 seatunnel 怎么配置Elasticsearch
  • ¥15 PSCAD安装问题 ERROR: Visual Studio 2013, 2015, 2017 or 2019 is not found in the system.
  • ¥15 (标签-MATLAB|关键词-多址)
  • ¥15 关于#MATLAB#的问题,如何解决?(相关搜索:信噪比,系统容量)
  • ¥500 52810做蓝牙接受端
  • ¥15 基于PLC的三轴机械手程序