Guest User

Untitled

a guest
Jan 18th, 2019
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. <?php
  2.  
  3. include 'config/mysql.php';
  4.  
  5. class myClass
  6. {
  7. private static $PDO = NULL;
  8. private static $tbl = 'questions';
  9.  
  10. public function selectNum()
  11. {
  12. $sql = 'SELECT * FROM ' . self::$tbl . 'WHERE used = 0';
  13. echo $sql;
  14.  
  15. }
  16.  
  17. private function _select( $sql )
  18. {
  19. if ( !self::$PDO ) die( mysql_error(). 'No database connection.' );
  20. $stmt = self::$PDO->query( $sql );
  21.  
  22. if ( $stmt && $stmt->rowCount() < 4 )
  23. {
  24. echo "your row count is less than 4";
  25. }
  26. else
  27. {
  28. echo "your row count is not less than 4";
  29. }
  30. }
Add Comment
Please, Sign In to add comment