| @@ 5-11 (lines=7) @@ | ||
| 2 | jRequire("ConnectionInterface.php"); |
|
| 3 | class MysqliAdapter implements ConnectionAdapterInterface { |
|
| 4 | public $connection; |
|
| 5 | public function __construct( $_srv, $_db, $_usr, $_pass ) { |
|
| 6 | try { |
|
| 7 | $this->connection = new mysqli( $_srv, $_usr, $_pass, $_db ); |
|
| 8 | } catch( Exception $e ) { |
|
| 9 | throw new JException($e->getMessage()); |
|
| 10 | } |
|
| 11 | } |
|
| 12 | public function query( $_query ) { |
|
| 13 | $this->stdQuery($_query); |
|
| 14 | return true; |
|
| @@ 12-19 (lines=8) @@ | ||
| 9 | throw new JException($e->getMessage()); |
|
| 10 | } |
|
| 11 | } |
|
| 12 | public function newTable( $_sql ) { |
|
| 13 | try { |
|
| 14 | $temp = $this->connection->exec($_sql); |
|
| 15 | } catch (Exception $e) { |
|
| 16 | throw new JException($e->getMessage()); |
|
| 17 | } |
|
| 18 | return $temp; |
|
| 19 | } |
|
| 20 | } |
|
| 21 | ?> |
|
| 22 | ||