<?php

include "../../include/function.php";
$name = $_GET['variety'];
$con = db_connect();
$result = avlabal($con, 'variety', 'variety', $name);
if ($result) {
    echo "The crop variety is already in the database.";
}
<?php

include "../../include/function.php";
$name = $_GET['crop'];
$con = db_connect();
$result = avlabal($con, 'crop', 'crop', $name);
if ($result) {
    echo "The crop is already in the database.";
}