试图将这些语句从pdo切换到mysqli

How can I change the following piece of code

try
{
    $dbh = new PDO('mysql:host=XXXXXX;dbname=XXXXXX', 'XXXXXX', 'XXXXXX');
}
catch(PDOException $e)
{
    print "Error!: " . $e->getMessage() . "<br/>";
    die();
}

and this piece of code

try
{
    $paginate = new pagination($page, 'SELECT * FROM demo_table ORDER BY id', $options);
}
catch(paginationException $e)
{
    echo $e;
    exit();
}

from pdo to mysqli so that they correspond with each other?

I don't see what difference the database makes to the pagination code block, based off of what you've provided. Have you done any research on mysqli? Its fairly straightforward.

At any rate, this code replaces your PDO code. Your pagination code block requires more details before that can be addressed.

 try
    {
            $dbh = new mysqli('host', 'username', 'password', 'database');
    }

    catch(Exception $e)
    {
            echo "Error: " $e->getMessage();
    }