标签:
百度NOTORM找到该库的官网 :http://www.notorm.com/
打开E:\AppServ\php7\php.ini
找到extension=php_pdo_mysql.dll
解开前面的;
下载并且观看demo:
include "NotORM.php"; $pdo = new PDO("mysql:host=localhost;dbname=myshop","root","202063sb"); $db = new NotORM($pdo); //shop_news为表名 foreach ($db->shop_news() as $news) { echo $news["news_title"]; } /* $applications = $db->application() ->select("id, title") ->where("web LIKE ?", "http://%") ->order("title") ->limit(10) echo $db->shop_news(); //SELECT * FROM shop_news echo "<br />"; echo $db->shop_news()->select("id, title"); //SELECT id, title FROM shop_news echo "<br />"; echo $db->shop_news()->select("id, title")->where("id = 1"); //SELECT id, title FROM shop_news WHERE (id = 1) */
标签:
原文地址:http://www.cnblogs.com/CyLee/p/5597796.html