search

Home  >  Q&A  >  body text

Why does registration fail?


//Connection library$link = new mysqli('localhost', 'root', 'root', 'login');if (!$link) { die("Connection failed: " . mysqli_connect_error()) ;}
$result = $link -> query("SELECT user FROM log WHERE user = "."'$user'");$rs = $result -> fetch_row();if (!empty( $rs)) { echo "<script>alert('User already exists!');location.href='../login.html';</script>";} else { $link = new mysqli( 'localhost', 'root', 'root'%

零宇塔时℡คิดถึง零宇塔时℡คิดถึง1791 days ago1083

reply all(1)I'll reply

  • lk

    lk2020-01-15 18:31:53

    Print out the sql statement and conduct an interview in the mysql tool

    reply
    0
  • Cancelreply