Why is correct id is not inserting into table : I want the following code to insert the cars id in customer_payment table but it only select 477 id. I don't know why. As it can be seen in image bellow only product_id 477 is inserted not any other if I select 500 it still inserts 477. Please help me on this help will be appreciated.  Thank you

[enter image description here][1]	


    include 'admin/db.php';
    
    if(isset($_GET['payment_here'])){
    	
    	//select product id from cart
    	$select_cart = "select * from cart";
    	$runcart = mysqli_query($conn, $select_cart);
    	$cartwhile=mysqli_fetch_assoc($runcart);
    
    	$carssid = $cartwhile['P_ID'];
    	$cusid = $cartwhile['C_ID'];
    	
    	//select id from cars
    	$scars = "select * from cars where id=$carssid";
    	$scarsrun = mysqli_query($conn, $scars);
    	$showcars = mysqli_fetch_assoc($scarsrun);
    	$carsdealer = $showcars['dealer'];
    
    	
    	//select customer id from customer  table
    	//$selectcust = "select * from customer_register where id=$cusid";
    	//insert data into customer payment table
    	echo $insertpay = "insert into customer_payment 
    	(Product_id, customer_id, dealer) 
    	values ( $carssid," . $_SESSION['customer_id'] . ", '$carsdealer')";
    	$run_inserts = mysqli_query($conn, $insertpay);
    	/*
    	if($run_inserts){
    		echo "<script>window.location.href = 'checkout.php'</script>";
    	}
    	*/
    }
    ?>


  [1]: http://i.stack.imgur.com/gQccg.jpg