Version 1.3 – PDOModel now supports Oracle and SQL Server along with PGSQL, SQLite and Mysql.
PDOModel provides a complete solution to perform CRUD operations on three different types of databases (Mysql, Postgres and Sqlite). It provides various helper functions to export data directly to csv,excel,xml,pdf,html and many more useful functions.
$pdomodel = new PDOModel(); //create object of the PDOModel class $pdomodel->connect("localhost", "root", "", "pdocrud");//connect to database $result = $pdomodel->select("emp"); //select * from `emp` That’s it, you need to write just 2-3 line of code. You can write very complex queries using PDOModel functions
$pdomodel = new PDOModel();//create object $pdomodel->connect("localhost", "root", "", "pdocrud");//connect to database - three different database type available /* INSERT , UPDATE AND DELETE OPERATION */ $pdomodel->insert("emp", array("firstName" => "John", "lastName" => "Jonathan", "gender" => "male")); $pdomodel->where("orderId", 7); $pdomodel->update("order", array("orderNumber"=>"44", "customerName"=>"BKG", "address"=>"140 shakti nagar")); $pdomodel->where("orderId", 7); $pdomodel->delete("order"); /* SELECT */ $result = $pdomodel->select("emp"); /* WHERE, AND, OR, BETWEEN, GROUP BY, ORDER BY, LIKE , HAVING */ $pdomodel->where("orderNumber", "5", "!="); $pdomodel->openBrackets ="("; $pdomodel->where("city", "Indore", "="); $pdomodel->andOrOperator="OR"; $pdomodel->closedBrackets =")"; $pdomodel->groupByCols = array("orderId"); $pdomodel->orderByCols = array("orderId desc", "state asc"); $pdomodel->havingCondtion = array("sum(orderId)>2"); $pdomodel->limit = "0,5"; $pdomodel->where("empId", array(36,37), "BETWEEN"); $pdomodel->where("firstName", '%P%', "LIKE"); $pdomodel->where("empId", array(36,37,39,40), "IN"); /* subquery/inner query */ $pdomodel->subQuery("select empId from emp where empId=?","empId",array(34)); /* where subquery */ $pdomodel->where_subquery("orderId", "select orderId from `order` where orderId=?", "IN",array(10)); /*rename, trucate, drop table, column name, primary key, tablefield info*/ $pdomodel->truncateTable("wp_postmeta"); $pdomodel->renameTable("states","state"); $pdomodel->dropTable("empleave"); $records = $pdomodel->columnNames("order"); $records = $pdomodel->primaryKey("order"); $records = $pdomodel->tableFieldInfo("order"); /*execute sql*/ $result = $pdomodel->executeQuery("select * from emp where empId = ?", array(39));
Added-
Added-
Added-
Added-