How to check element existence in the database?

The browser gives 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(draft)
or die('Error #01');

$cc = $_POST['info'];
$res1 = "SELECT * FROM cc_user WHERE user = 'cc'";
$res = mysql_query($connect,$res1) or die('Error #02');
if(mysql_num_rows($res)){
echo 'took something';
}else{
echo 'Nothing';
}
mysqli_close($connect);
 ?>


Help to fix it...
July 2nd 19 at 14:24
1 answer
July 2nd 19 at 14:26
Solution
replace
$res = mysql_query($connect,$res1) or die('Error #02');

on
$res = mysqli_query($connect,$res1) or die('Error #02');


and
if(mysql_num_rows($res)){
on
if(mysqli_num_rows($res)){
Thank you - Kris45 commented on July 2nd 19 at 14:29

Find more questions by tags PHPMySQLSQL