数据没有插入mysql表中

<?php 
include 'dbh.php';
session_start();

if (isset($_GET['gmail'])) {
    $gname = $_GET['gmail'];
}

$gname = mysqli_real_escape_string($connect, $gname);
$_SESSION['myusername'] = $gname;

$today = date("d.m.y");

$k=0;

$sql = "SELECT cart_fext FROM cart WHERE cart_sess = '$sess'";
$result=mysqli_query($connect, $sql);

$kode[$k] = array();
$kame[$k] = array();
$kesc[$k] = array();
$kail[$k] = array();
$kid[$k] = array();
$kate[$k] = array();

while ($row = mysqli_fetch_array($result, MYSQLI_ASSOC)) {
    extract($row);
    $k = $k + 1;
    $cname=$row['cart_item_name'];
    $csize=$row['item_size'];
    $cdesc=$row['cart_desc'];
    $cfpath=$row['cart_fpath'];
    $cfext=$row['cart_fext'];
    $ccode=$row['cart_itemcode'];
    $cuserid=$row['cart_usrid'];

    $kode[$k] = $ccode;
    $kame[$k] = $cname;
    $kesc[$k] = $cdesc;
    $kail[$k] = $gname;
    $kid[$k] = $cuserid;
    $kate[$k] = $today;
}

for($i=1; $i<=$k; $i++) { 

    $sqlsal = "INSERT INTO sales (s_code, s_name, s_desc, s_mail, s_userid, s_date) VALUES ('$kode[$i]', '$kame[$i]', '$kesc[$i]', '$kail[$i]', '$kid[$i]' ,'$kate[$i]')";
    $result=mysqli_query($connect, $sqlsal);

}
header("location:makedir.php");
?>

my table sales is just not accepting data, dbh.php is to connect to the database I don't understand what is wrong with this script? please help?

I have checked your insert query it is running fine but I think the problem is with your SELECT query

SELECT cart_fext FROM cart WHERE cart_sess = '$sess'

please print the result of the query. I think that it may not be giving any result.