Guest User

Untitled

a guest
May 24th, 2018
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. <?php
  2.  
  3. include_once "chain_record_define.php";
  4.  
  5. /* $obj has same named properties with group table columns. */
  6. $obj = new Group();
  7.  
  8. $t1 = "this script writen by php.";
  9. $t2 = "how to use ChainRecord library.";
  10.  
  11. /* get rows as group model objects in groups table. */
  12. $ret = $obj->find(array(
  13. "cond" => array("title = ? or title = ?", $t1, $t2),
  14. "order" => "id desc",
  15. "limit" => 5
  16. )
  17. );
  18. /* SQL: SELECT * FROM groups WHERE title = ? or title = ? ORDER BY id desc LIMIT 5 */
  19. /* parameter $1, $2 binded to each '?' by database api */
  20. ?>
Add Comment
Please, Sign In to add comment