$q = "select * from product_design where design_size = $del_id";
$res = mysqli_query($mysqli,$q);
if(mysqli_num_rows($res) > 0) {
$_SESSION['product_size']['error'][] = "This product size can't Deleted, because it used with some products";
}
else{
$q = "DELETE from product_size where size_id = $del_id";
$res = mysqli_query($mysqli,$q);
$_SESSION['product_size']['success'] = 'Size deleted successfully';
}
$res = mysqli_query($mysqli,$q);
if(mysqli_num_rows($res) > 0) {
$_SESSION['product_size']['error'][] = "This product size can't Deleted, because it used with some products";
}
else{
$q = "DELETE from product_size where size_id = $del_id";
$res = mysqli_query($mysqli,$q);
$_SESSION['product_size']['success'] = 'Size deleted successfully';
}