PHP POST方法没有从ajax POST接收数据

I have checked thoroughly through my code and I am not seeing the problem. Looked for other questions similar to mine and found that most just skipped $_POST['something'] parts. Here is what I have for ajax:

$(document).on('click','#smallbtn',function(){

        var postuserid = $(this).data("postuserid");
            $post = $(this);
            console.log($(this).data("postuserid"));

        $.ajax({

            url: 'cooking.php',
            type: 'POST',
            data: {
                'postuserid': postuserid
            },

        });
    });

Most answers said that to use $(document).on('click','#smallbtn',function(). When before I just used $(documemt) ready. (Which console logged as soon as I entered the page.) Through jQuery, I am using the latest .data when before I used .attr. Both gave me the same and correct result in the console.log. Here is my PHP:

$uid = $_POST['postuserid'];
$db = mysqli_connect("localhost", "root", "password", "testdb");
        $ssql = "SELECT * FROM mainid WHERE postid='$uid'";
        $rresult = mysqli_query($db,$ssql);
        while($lrow = mysqli_fetch_assoc($rresult)){
            echo $lrow['smallid'];
            echo '<br>';
        }

I am not sure what's going on here because I do have the correct $_POST['postuserid']. And lastly:

echo '<a  href="#" data-postuserid="'.$row['id'].'" id="smallbtn" data-toggle="modal" data-target="#small"  data-modal="small">';

There has to be something I am doing wrong here, any help is appreciated!

UPDATE: The data is visible in the console log, but not visible in the modal.

UPDATE 2: The data is just not visible for some reason whether it is in the modal or not. But it is in the console.

UPDATE 3: poseruserid is not being set in the POST Method and the query is not receiving anything.