Insert data if number of rows is greater than 0 does not work
问题 I have this PHP function which will insert urls into MySQL, but only those which didn't exist until moment of executing. I have a problem, my if condition is simply ignored, so everything goes to database, ignoring the condition. Code is here: function storeLink($url,$gathered_from) { global $conn; $querycheck = "SELECT COUNT(*) FROM test WHERE link = '$url'"; $resultcheck = mysqli_query($conn, $querycheck); $row = mysqli_fetch_array($resultcheck, MYSQLI_ASSOC); if($row['COUNT(*)'] < 1); {