Last active
May 17, 2020 09:51
-
-
Save XxAnonimeKxX/54343137b46920e9d7adb1bfb92625f6 to your computer and use it in GitHub Desktop.
php
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public function get($table, $field, $operator, $value){ | |
| $sql = "SELECT * FROM ". $table ." WHERE " . $field . $operator . $value; | |
| $query = $this->_pdo->query($sql); | |
| $r = $query->fetchAll(); | |
| print_r($r); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require_once 'classes/DB.php'; | |
| $prod = new DB; | |
| $prod->get('products', 'id', '>', '0'); | |
| foreach ($prod as $p) { | |
| echo $p; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment