I changed $result = mysqli_stmt_get_result($stmt); to bind_result. It gives me error now

I am a beginner to php. I watched a tutorial to upload image to database and display it. It worked on localhost but when I moved it online it gave me Fatal error: Call to undefined function mysqli_stmt_get_result() , because my server’s php version was old. So as I read here I had to change mysqli_stmt_get_result to mysqli_stmt_bind_result . And now it gives me Wrong parameter count for mysqli_stmt_bind_result() and mysqli_fetch_assoc() expects parameter 1 to be mysqli_result, null given here is my full code:

<?php
        include_once 'db.php';
        $sql = 'SELECT * FROM table1 ORDER BY id DESC';
        $stmt = mysqli_stmt_init($connect);
        if (!mysqli_stmt_prepare($stmt, $sql)) {
          echo "SQL statement failed";
        }
        else{
          mysqli_stmt_execute($stmt);
          $result = mysqli_stmt_bind_result($stmt);
          while ($row = mysqli_fetch_assoc($result)) {
        
echo '
 <div class="col-xs-6 col-md-4">
   <div class="product tumbnail thumbnail-3"><a href="#"><img src="upload/'.$row["pictureq"].'" width="300" height="300" alt=""></a>
     <div class="caption">
       <h6><a href="#">'.$row["name"].'</a></h6>
       <span class="price sale">'.$row["price"].'$</span>
       <p class="text-justify" style="word-wrap: break-word; width:300px;">'.$row["description"].'</p>
     </div>
   </div>
 </div>';}}?>

And here is my other file that this code is related to (if I had any mistakes):

<?php
if (isset($_POST['send'])) {
$newFileName = $_POST['name'];
if (empty($newFileName)) {
    $newFileName= "catalog";

}
else{
    $newFileName = strtolower(str_replace(" ", "-", $newFileName));
    }

$price =$_POST["price"]."$";
$name =$_POST["name"];
$desc =$_POST["desc"];
$file=$_FILES['pictureq'];

$fileName = $file["name"];
$fileType = $file["type"];
$fileTempName = $file["tmp_name"];
$fileError = $file["error"];
$fileSize = $file["size"];

$fileExt = explode(".", $fileName);
$fileActualExt = strtolower(end($fileExt));

$allowed = array("jpg", "jpeg", "png");


if (in_array($fileActualExt, $allowed)) {
    if ($fileError === 0 ) {
        if ($fileSize < 200000) {
            $pictureq = $newFileName . "." . uniqid("", true). "." . $fileActualExt;
            $fileDestination = "upload/" . $pictureq;
            include_once "db.php";

            if (empty($name)|| empty($desc)) {
                echo "Empty name or description.";
            }
            else{
                $sql= "SELECT * FROM table1; ";
                $stmt = mysqli_stmt_init($connect);
                if (!mysqli_stmt_prepare($stmt, $sql)) {
                    echo "SQL statement failed!";
                }
                else{
                    mysqli_stmt_execute($stmt);
                    $result = mysqli_stmt_get_result($stmt);
                    $rowCount = mysqli_num_rows($result);
                    $incase = $rowCount + 1;

    $sql = "INSERT INTO table1(price, name, description, pictureq, incase) VALUES(?,?,?,?,?)";

                if (!mysqli_stmt_prepare($stmt, $sql)) {
                echo "SQL statement failed!  ";
                } 
                else{   
                mysqli_stmt_bind_param($stmt, "sssss", $price, $name, $desc, $pictureq, $incase);
                mysqli_stmt_execute($stmt);
                move_uploaded_file($fileTempName, $fileDestination);
                echo "Update Success - ";
                }
                }
            }
        }
        else{
            echo "File size is too big.";

        }
    }
    else{
        echo "ERROR";
    }
}
else{
    echo "Wrong file extension";
    exit();
}
}   
?>

I have to finish this. I have been struggling on this for 4 days now. Any help would be appreciated. Thanks.