Recommend this page to a friend! |
![]() |
Info | Example | ![]() |
![]() |
![]() |
Reputation | Support forum | Blog | Links |
Ratings | Unique User Downloads | Download Rankings | ||||
Not yet rated by the users | Total: 121 | All time: 9,494 This week: 455![]() |
Version | License | PHP version | Categories | |||
php-mysql-class 1.0 | The PHP License | 5 | PHP 5, Databases |
Description | Author | |
This package can compose and execute SQL queries on MySQL using PDO. |
|
<?php
|
Mysql Connection V1
<?php
define('DBHost', 'localhost');
define('DBName', 'northwind');
define('DBUser', 'root');
define('DBPassword', '');
define("connection","connection");
$db = new DatabaseController(DBHost, DBName, DBUser, DBPassword,connection);
?>
| OrderID | EmployeeID | ShipName |:-----------:|:------------:|:------------:| | 10249 | 6 | red | 10250 | 4 | yellow | 10251 | 3 | green | 10252 | 4 | yellow | 10253 | 3 | red
TableName, Data:
$tableName = "Orders";
$data = Array
(
"ShipName" => "Blue",
"ShipAddress" => "Nottingham",
"ShipCity" => "UK"
);
Insert Method
<?php
$methodInsert = $method->Insert($tableName,$data);
?>
TableName, Id , Data:
$tableName = "Orders";
$Id = array(
"OrderID" => "1"
);
$data = Array
(
"ShipName" => "Blue",
"ShipAddress" => "Nottingham",
"ShipCity" => "UK"
);
Update Method
<?php
$methodUpdate = $method->Update($tableName', $id, $data);
?>
TableName, Id:
$tableName = "Orders";
$Id = array(
"OrderID" => "1"
);
Delete Method
<?php
$methodDelete = $method->Delete($tableName,$id);
?>
TableName:
$tableName = "Orders";
Select_all Method
<?php
$methodSelectAll = $method->Select_all($tableName);
?>
TableName, Data:
$tableName = "Orders";
$data = Array
(
"ShipName", "ShipAddress", "ShipCity"
);
Select_ch Method
<?php
$methodSelectCh = $method->Select_ch($tableName,$data);
?>
TableName, Data, Conn, If:
$tableName = "Orders";
$data = Array
(
"EmployeeID" => "4"
);
$conn = Array
(
"!="
);
$if = Array
(
"AND"
);
Select_wh Method
<?php
$methodSelectWh = $method->Select_wh($tableName, $data, $conn, $if);
?>
The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page. |
![]() |
Version Control | Unique User Downloads | Download Rankings | |||||||||||||||
100% |
|
|
Applications that use this package |
If you know an application of this package, send a message to the author to add a link here.