微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

Zebra_Database PHP的MySQL扩展

程序名称:Zebra_Database

授权协议: LGPL

操作系统: 跨平台

开发语言: PHP

Zebra_Database 介绍

Zebra_Database 是一个高级的、紧缩的(只包含单个文件)、轻量级的、面向对象的 MysqL 数据库访问封装器,基于 PHPMysqL
扩展开发。提供了各种用于与 MysqL 数据库交互的直观方法,比 PHP 自带的更有趣。

示例代码

 debug = true;

$db->connect('host', 'username', 'password', 'database');

// code goes here

// this should always be present at the end of your scripts;
// whether it should output anything should be controlled by the $debug property
$db->show_debug_console();
// $criteria will be escaped and enclosed in grave accents, and will
// replace the corresponding ? (question mark) automatically
$db->select(
    'column1, column2',
    'table',
    'criteria = ?',
    array($criteria)
);

// after this, one of the "fetch" methods can be run:

// to fetch all records to one associative array
$records = $db->fetch_assoc_all();

// or fetch records one by one, as associative arrays
while ($row = $db->fetch_assoc()) {
    // do stuff
}

$db->insert(
    'table',
    array(
        'column1' => $value1,
        'column2' => $value2,
    )
);
?>

Zebra_Database 官网

http://stefangabos.ro/php-libraries/zebra-database/

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。

相关推荐