note 68885 added to function.mysqli-prepare

From: Date: Mon, 14 Aug 2006 20:38:50 +0000
Subject: note 68885 added to function.mysqli-prepare
Groups: php.notes 
Request: Send a blank email to php-notes+get-115908@lists.php.net to get a copy of this message
After a little searching, I've implemented the following method to extend the mysqli class when using prepared statements. Please forgive the simplicity of the code: <?php class DB extends mysqli { public $host = 'localhost'; public $user = 'username'; public $pass = 'password'; public $dbse = 'database'; public function __construct ( ) { parent::__construct( $this->host, $this->user, $this->pass, $this->dbse ); } public function prepare ( $query = '' ) { return new PS( $this, $query ); } } class PS extends mysqli_stmt { public function __construct ( $mysqli, $query ) { parent::__construct( $mysqli, $query ); } } ---- Server IP: 64.71.164.2 Probable Submitter: 68.97.15.32 ---- X-Spam-Status: No, hits=3.1 required=5.0 tests=DATE_MISSING,FROM_NO_LOWER autolearn=no version=2.64 ---- Manual Page -- http://www.php.net/manual/en/function.mysqli-prepare.php Edit -- https://master.php.net/note/edit/68885 Del: integrated -- https://master.php.net/note/delete/68885/integrated Del: useless -- https://master.php.net/note/delete/68885/useless Del: bad code -- https://master.php.net/note/delete/68885/bad+code Del: spam -- https://master.php.net/note/delete/68885/spam Del: non-english -- https://master.php.net/note/delete/68885/non-english Del: in docs -- https://master.php.net/note/delete/68885/in+docs Del: other reasons-- https://master.php.net/note/delete/68885 Reject -- https://master.php.net/note/reject/68885 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#115908) next »