Advertisement
Guest User

Untitled

a guest
Apr 23rd, 2014
46
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.92 KB | None | 0 0
  1. function selectAllSorted($active)
  2. {
  3. return $this->selectObjects("SELECT bp.*, p.title as product_title
  4. FROM $this->_table bp
  5. INNER JOIN ?_product p USING (product_id)
  6. ORDER BY 0+sort_order,p.title");
  7. }
  8.  
  9. function selectAllSorted($active)
  10. {
  11. return $this->selectObjects("SELECT bp.*, p.title as product_title
  12. FROM $this->_table bp
  13. WHERE product_id =$active
  14. INNER JOIN ?_product p USING (product_id)
  15. ORDER BY 0+sort_order,p.title");
  16. }
  17.  
  18. function selectObjects($sql, $param1 = null)
  19. {
  20. $args = func_get_args();
  21. $q = call_user_func_array(array($this->_db, 'queryResultOnly'), $args);
  22. $ret = array();
  23. while ($row = $this->_db->fetchRow($q))
  24. {
  25. $obj = new $this->_recordClass($this);
  26. $obj->fromRow($row);
  27. $ret[] = $obj;
  28. }
  29. return $ret;
  30. }
  31.  
  32. function selectAllSorted($active)
  33. {
  34. return $this->selectObjects("SELECT bp.*, p.title as product_title
  35. FROM $this->_table bp
  36. INNER JOIN ?_product p USING (product_id)
  37. WHERE bp.product_id =$active
  38. ORDER BY 0+sort_order,p.title");
  39. }
  40.  
  41. Select t1.* from table1 t1
  42. inner join table2 t2 on t1.col1=t2.col1
  43. where t1.col2> 0 and t2.col3>4
  44.  
  45. function selectAllSorted($active)
  46. {
  47. return $this->selectObjects("SELECT bp.*, p.title as product_title
  48. FROM $this->_table bp
  49. INNER JOIN ?_product p on pb.product_id=p.product_id
  50. WHERE bp.product_id =$active
  51. ORDER BY 0+sort_order,p.title");
  52. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement