Home  >  Q&A  >  body text

mysqli function

When using functions such as mysqli_num_rows() in the tp5.1 framework, an error will be reported. Can these functions not be used on TP?

林瑞程林瑞程1891 days ago1321

reply all(5)I'll reply

  • 阿亮

    阿亮2019-11-06 15:06:24

    Now they are all object-oriented-new mysqli or pdo

    reply
    0
  • 林瑞程

    I queried the database before and found that the IDs were out of order, so I wanted to sort them using a cursor or something. Do you know any way to do this?

    林瑞程 · 2019-11-06 15:17:32
  • 移动用户-8803494

    移动用户-88034942019-09-09 10:26:04

    DB_TYPE is set to mysqli

    reply
    0
  • 林瑞程

    Thank you very much for your reply. In which file is the configuration you are talking about located?

    林瑞程 · 2019-09-09 20:01:30
    林瑞程

    I changed the database link type in the database.php file and changed mysql to mysqli but still reported an error that the class does not exist: \think\db\connector\Mysqli. After checking the reason, it seems that tp5.1 does not support it. Before tp5, just change it to mysqli.

    林瑞程 · 2019-09-09 21:07:23
  • Cancelreply