警告:非法字符串偏移 - PHP mySQL

Warning: Illegal string offset 'slimg' in /opt/lampp/htdocs/linom/index.php on line 82

<?php
    $slider = "SELECT * FROM post ORDER BY id ASC LIMIT 4";
    $slider1 = mysqli_query($connect,$slider);
    $sliderV = mysqli_fetch_array($slider1);

    do {
        printf ("<div class='slider'>
        <a href='view.php?id=%s'>
            <figure>
                <img class='slideimg' src=%s>
                <figcaption>
                    %s
                </figcaption>
            </figure>
        </a>
        </div>",$sliderV['id'],$slider['slimg'],$sliderV['title']); //here is error
    }
    while ($sliderV = mysqli_fetch_array($slider1));
?>

Your variable names aren't very clear. You accidentally referenced the query string instead of the array:

$sliderV['slimg']

I recommend using better variable names, such as $slider_sql, $slider_query, and $slider.