//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'%