Zebra_Database是一个高级的、紧缩的(只包含单个文件)、轻量级的、面向对象的MySQL数据库访问封装器,基于PHP的 MySQL扩展开发。提供了各种用于与MySQL数据库交互的直观方法,比PHP自带的更有趣。
示例代码:
debug=true;$db->coect('host','userame','password','database');//codegoeshere//thisshouldalwaysbepresetattheedofyourscripts;//whetheritshouldoutputaythigshouldbecotrolledbythe$debugproperty$db->show_debug_cosole();//$criteriawillbeescapedadeclosedigraveaccets,adwill//replacethecorrespodig?(questiomark)automatically$db->select('colum1,colum2','table','criteria=?',array($criteria));//afterthis,oeofthe"fetch"methodscaberu://tofetchallrecordstooeassociativearray$records=$db->fetch_assoc_all();//orfetchrecordsoebyoe,asassociativearrayswhile($row=$db->fetch_assoc()){//dostuff}$db->isert('table',array('colum1'=>$value1,'colum2'=>$value2,));?>










评论