Re: [DB] Suggestion for field types

From: Date: Fri, 09 Jan 2004 02:59:24 +0000
Subject: Re: [DB] Suggestion for field types
References: 1 2 3 4 5  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-24920@lists.php.net to get a copy of this message
Hi Peter,
What do you get if you do: $res = $db->query('sel...'); $tinfo = $res-tableInfo(); print_r($tinfo); ? You're right, I'm sorry. I wasn't really thinking of the native native API metadata methods as being "reliable" for some reason. I guess they exist for most databases, but with Creole we ended up having to rely exclusively on queries for metadata. We had to use queries so that, e.g., we could get things like default values for columns and precision/scale. Also it seems that functions like mysql_field_type() return the PHP type, and not the MySQL type for the column... It seems like the pg_field_type() returns real postgres types .... it's unfortunate that this isn't consistent. In SQLite also there was no way to get around performing queries to get the metadata.
I'll have to look at the mysqli extension & see if that provides a way to get native MySQL types. It would be very nice to have resultset metadata. Thanks for persisting with your point -- glad to get to re-evaluate the possiblity of adding a ResultSetMetadata / ResultSetInfo class to Creole. Cool :) Cheers, Hans

« previous php.pear.dev (#24920) next »