Re: PDO concerns
| From: | Lukas Smith | Date: | Mon, 28 Feb 2005 08:38:12 +0000 |
| Subject: | Re: PDO concerns | ||
| References: | 1 | Groups: | php.pecl.dev |
| Request: | Send a blank email to pecl-dev+get-2089@lists.php.net to get a copy of this message | ||
Richard Thomas wrote:
MySQL in php has always supported the use of rowCount() to return the number of results in a SELECT, to change this behaviour all of a sudden in PDO is going to cause some confusion to say the least. PDO as I knew
You can not do multiple querys without declaring your $return variable as null hence destorying the prior object. Now this one I may be off butThese are valid concerns and we have discussed them. The problem is these are growing pains as we are trying to make the way you talk to databases in PHP better. PDO has alot of really cool ways you can fetch data from the RDBMS. One of them is fetchAll(). Now alot of people will be thinking: What? Now I need to fetch the entire result set before I can execute another result set or let alone get the number of rows in the result set? The answer is yes. However this is not a new fact. Buffered queries as mysql_query() has always returned did just that. it read the entire result set into the client. The only difference was that back then you had to make a function call for every row. Had to dump all data into an array or call mysql_data_seek() if you wanted to skip back and forth etc. If we would stick with this API we would have to reinvent all sorts of Iterators that are already available for arrays. You would loose out in the convinience department and yes you would even loose out in the performance department. So yes there will be a WTF? factor and yes we even talked about that fact that this needs to be documented and IIRC Dan raised his hand :-) regards, Lukas