Answer the question
In order to leave comments, you need to log in
'SELECT' how to use query result in if?
$connect=new mysqli("localhost","root","","Derk");
function security($string)
{
$string=stripslashes($string);
$string=htmlentities($string);
// $string=mysqli_real_escape_string();
return $string;
}
if(isset($_POST['regist']))
{
$RegName=$_POST['RegName'];
$RegPassword=$_POST['RegPassword'];
$RegName=security($RegName);
$RegPassword=security($RegPassword);
//////////////////////////////////СМОТРЕТЬ СЮДА
$query="SELECT * FROM 'MYLOGIN' WHERE 'Login' LIKE '$RegName'";
$result=$connect->query($query);
if($result->num_rows>0)// $result==true/false тоже не работают.
{
$error="This Username already exists, please try another name!";
echo "ERROR";
}
////////////////////////////////////
Answer the question
In order to leave comments, you need to log in
var_dump! var_dump! var_dump! var_dump! var_dump! var_dump! var_dump! var_dump! var_dump! var_dump!
Learn to look for errors in code!!!!! It’s obviously crap somewhere - it means we’re going from nose to tail, poking the wardump everywhere, first what came to the post, then we returned the security functions (whatever it is), then we check the qveri string, if it’s formed correctly, we execute the request with our hands from mayadmin For example. A piece of something is either missing or written incorrectly, the closing brace of the first if is missing altogether.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question