Maison > Article > développement back-end > php数据库有关问题,
php数据库问题,求助。。。。
初学PHP来的,想自己写一个登陆的页面,但现在连验证帐号都过不去,请大家看下我的代码是哪里有问题
<?php <br />$user123 = $_POST['user']; <br />$db = new mysqli($sqln,$sqlu,$sqlp,$sqld) or die("Error in the consult.." . mysqli_error($db)); <br />$query = "SELECT 'user_email' FROM 'user' WHERE 'user_email' = '$user123'"; <br />// mysql_select_db($sqld); <br />mysqli_select_db($db, $sqld); <br />$result = $db->query($query) or die("Error in the consult.." . mysqli_error($db)); <br />if ($result == 1){ <br />echo "<p> 登陆成功 </p>"; <br />} <br />elseif ($result == 0){ <br />echo "<p> 没有找到 </p>"; <br />} <br /><br />echo $_POST["user"]; <br />$dba = $db->affected_rows; <br />echo $dba; <br />mysqli_close($db); <br />?>