search

Home  >  Q&A  >  body text

Guys, what’s wrong with connecting to the database? I can’t log in to the background.

<?php
error_reporting(0);
session_start();  
mysql_connect("localhost","admin","admin");
mysql_select_db("xiehuoming");
mysql_query("set character_set_server='utf8'"); 
mysql_query("set names 'utf8'");


?>

How to solve this?

perfectperfect1808 days ago1287

reply all(2)I'll reply

  • Guanhui

    Guanhui2020-05-04 11:45:25

    The mysql function is used incorrectly, and the mysql_ function has been removed in php7 and above versions.

    reply
    1
  • 大湖

    大湖2020-04-05 22:38:55

    Aren’t they all using mysqli to connect?

    reply
    0
  • Cancelreply