Answer the question
In order to leave comments, you need to log in
How to check if an element exists in the database?
Browser throws an error: Warning: mysql_query() expects parameter 1 to be string, object given in info.php on line 7
Error #02;
<?php
$connect = mysqli_connect(скрыто)
or die('Ошибка #01');
$cc = $_POST['info'];
$res1 = "SELECT * FROM user WHERE cc_user = 'cc'";
$res = mysql_query($connect,$res1) or die('Ошибка #02');
if(mysql_num_rows($res)){
echo 'Что-то достали';
}else{
echo 'Ничего нет';
}
mysqli_close($connect);
?>
Answer the question
In order to leave comments, you need to log in
replace
$res = mysql_query($connect,$res1) or die('Ошибка #02');
if(mysqli_num_rows($res)){
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question