码迷,mamicode.com
首页 > 数据库 > 详细

php 第三方DB库NOTORM

时间:2016-06-19 13:01:42      阅读:355      评论:0      收藏:0      [点我收藏+]

标签:

百度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)
*/

 

php 第三方DB库NOTORM

标签:

原文地址:http://www.cnblogs.com/CyLee/p/5597796.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!