Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /* -- inside the class --*/
- public function select($reqSelect, $parameters = array(':id' => $id_to_select)) {
- try {
- $this->con = parent::beginTransaction();
- $result = parent::prepare($reqSelect);
- $result->execute($parameters);
- //$this->con = parent::commit();
- $this->con = parent::rollBack();
- return $result;
- $result->closeCursor();
- } catch (Exception $e) {
- die('Error:' . $e->getMessage());
- }
- }
- /* -- inside the class --*/
- $mysql = new Mysql();
- $mysql->select('SELECT * FROM articles WHERE id = :id ');
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement