| file name: | Examples-5.php |
| Size: | 1.34 KB |
| date: | 3 months ago |
This file is located in class-query.1.0.zip
<?php
//select-from-table-with-group-by
require 'class-query.php';
$q=new Query;
$result=$q
->select(
array(
'`name`',
'`company`',
'`email`'
)
)
->from('`invoice`')
->group_by(
'`name`,'.
'`company`,'.
'`email`'
)
->where_like(
array(
'`email`'=>'user@example.com'
)
)
->order_by(
'`name` ASC,'.
'`company` ASC'
)
/*
->run();
*/
->show();
exit;
/*
SELECT
`name`,
`company`,
`email`
FROM
`invoice`
WHERE
`email` LIKE '%user@example.com%'
GROUP BY
`name`,`company`,`email`
ORDER BY
`name` ASC,`company` ASC
*/
?>