没有任何数据可供显示
开源项目社区 | 当前位置 : |
|
oss.trustie.net/open_source_projects | 主页 > 开源项目社区 > php-mysql-like-ror |
php-mysql-like-ror
|
0 | 0 | 6 |
贡献者 | 讨论 | 代码提交 |
概述
This is a library coded by PHP for MySQL manipulation, and use it like Ruby on Rails.Example:require 'php_mysql_like_ror.php';
$mysql = new MySQL("localhost", "cfc", "cfc", "wtf"); // Default encoding is UTF-8
$mysql->Conn();
$mysql->Exec(find_all_by_field("id", 10, "users")); // Same as: mysql_query("SELECT * FROM `users` WHERE id = 10");
// Same as: mysql_fetch_assoc(mysql_query("SELECT * FROM `users` WHERE id BETWEEN 10 AND 20 LIMIT 5"));
$mysql->fetch_assoc(find_all("users", array("conditions" => "id BETWEEN 10 AND 20", "limit" => 5)));
$mysql->getCount(find_all("users", array("select" => "id"))); // Same as: mysql_num_rows(mysql_query("SELECT id FROM `users`"));
$mysql->Close();
$mysql = null;
创建时间:2014-05-07 04:05