note 104954 added to book.mysql

From: Date: Mon, 18 Jul 2011 18:03:13 +0000
Subject: note 104954 added to book.mysql
Groups: php.notes 
Request: Send a blank email to php-notes+get-181670@lists.php.net to get a copy of this message
I've created 2 classes, the first one is MySQL, it has a private attribute called link, the other one is called Result, and has a private attribute of the same name. In the first class there's a private method that uses mysql_error and mysql_errno to assemble a message and throw an Exception with it. The method is called everytime the class "talks" to the database and something returns false when it shouldn't. Also it's constructor has the same methods as the connect function, except for $new_link which is always true. The second class is composed by all mysql_ functions that don't need a link resource but a result resource, and that is suplied by the private atribute. In both cases the resource link/result is returned by the toString method, which is called by the __toString magic method as well. I guess that fixes it for now... (will zip and send it later) ---- Server IP: 69.147.83.197 Probable Submitter: 187.55.215.170 ---- Manual Page -- http://www.php.net/manual/en/book.mysql.php Edit -- https://master.php.net/note/edit/104954 Del: integrated -- https://master.php.net/note/delete/104954/integrated Del: useless -- https://master.php.net/note/delete/104954/useless Del: bad code -- https://master.php.net/note/delete/104954/bad+code Del: spam -- https://master.php.net/note/delete/104954/spam Del: non-english -- https://master.php.net/note/delete/104954/non-english Del: in docs -- https://master.php.net/note/delete/104954/in+docs Del: other reasons-- https://master.php.net/note/delete/104954 Reject -- https://master.php.net/note/reject/104954 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#181670) next »