本文整理匯總了PHP中connection::results_object方法的典型用法代碼示例。如果您正苦於以下問題:PHP connection::results_object方法的具體用法?PHP connection::results_object怎麽用?PHP connection::results_object使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類connection
的用法示例。
在下文中一共展示了connection::results_object方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: connection
/**
* Exemplos de uso para class connection
* @author Antonio Santos
* @version 0.1
*/
$db = new connection();
/**
* Exemplo de insert
*/
$fields_insert = array('field1' => 'first inserted field', 'field2' => 'second inserted field', 'field3' => 'third inserted field');
$result = $db->insert('table_name', $fields_insert, 'id');
/**
* Exemplo de select
*/
$result = $db->select('table_name', array('*'), array('id' => 1));
/**
* Exemplo de update
*/
$fields_update = array('field1' => 'first updated field', 'field2' => 'second updated field', 'field3' => 'third updated field');
$conditions = array('user' => 'tester');
$result = $db->update('table_name', $fields_update, $conditions, 'id');
/**
* Exemplo de delete
*/
$conditions = array('id' => 1);
$result = $db->delete('table_name', $conditions);
/**
* Exemplo de outras queries
*/
$result = $db->results_object('SELECT e.first_name, e.last_name, u.user_type, u.username FROM table_name AS e INNER JOIN second_table_name AS u ON e.id = u.employee_id');