Re: Another PDO ?
| From: | Lester Caine | Date: | Mon, 10 Sep 2012 15:10:37 +0000 |
| Subject: | Re: Another PDO ? | ||
| References: | 1 2 3 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-48479@lists.php.net to get a copy of this message | ||
Jim Giner wrote:
On 9/10/2012 10:49 AM, Bastien Koert wrote:You do not necessarily KNOW how many fields. You know how many fields should be in the version of the database you are coding for, so any difference would flag a problem. Also you may not ACTUALLY have the schema for a database in which case a count of the fields found is useful for further processing those fields. Another area is when you are working with fabricated joined queries where duplicate field names between tables will give a reduced number of final fields in the result. Of cause it IS often better to work with named fields rather than using '*' which does allow better handing of the process anyway. -- Lester Caine - G8HFL ----------------------------- Contact - http://lsces.co.uk/wiki/?page=contact L.S.Caine Electronic Services - http://lsces.co.uk EnquirySolve - http://enquirysolve.com/ Model Engineers Digital Workshop - http://medw.co.uk Rainbow Digital Media - http://rainbowdigitalmedia.co.ukOn Mon, Sep 10, 2012 at 9:48 AM, Jim Giner <jim.giner@albanyhandball.com> wrote:But - again - one already knows how many fields are in that table when one writes the query...Reading up on the pdostatement class. Wondering what the intent of the columnCount function is. I mean, aren't the number of columns in a result known when you write the query? Granted, you might have some very complex query that you may not know the number, but for most queries you will know the columns you are expecting. So - what am I not seeing? -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.phpIt might be for those cases where you run a select * from ...