php之mysqli通用操作类(基本体)

工具类源码
mysqli = new mysqli($local, $user, $pwd, $dbs);
        $this->mysqli->set_charset("utf8");
    }

    //执行sql
    function excmd($sqls)
    {
        $result = $this->mysqli->query($sqls);
        return $result;
    }
}

?>



测试代码:

excmd("select * from bookinfo");
while (! ! $row = $result->fetch_row()) {
    echo $row[1] . "
"; } ?>


初步测试运行正常,待继续完善

你可能感兴趣的:(步入PHP)