note 20197 added to function.ingres-field-type
| From: | burckhardtCUTMEOUT at gsf dot de | Date: | Tue, 26 Mar 2002 09:11:08 +0000 |
| Subject: | note 20197 added to function.ingres-field-type | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-28219@lists.php.net to get a copy of this message | ||
I have to apologise for the previous two long postings, but information referring to the INGRES data
types is a bit hard to find, so I want to share it. Below is my translation script for
INGRES->MySQL data types.
<?
// Fieldtype Translator INGRES => MySQL (c) F.Burckhardt
// translates string, int, date; might be incomplete with respect to other INGRES data-types
$sql="SELECT * FROM table";
$conn = ingres_connect ($database, $user, $password);
$results = ingres_query($sql,$conn);
$fieldtype = array ( "key" => "val");
$ingres_translation = array( "IIAPI_VCH_TYPE" => "string",
"IIAPI_CHA_TYPE" => "string",
"IIAPI_INT_TYPE" => "int",
"IIAPI_DTE_TYPE" => "date");
for($i=1; $i<ingres_num_fields($conn)+1; $i++) {
$fieldtype [ingres_field_name($i,$conn)] = $ingres_translation[ingres_field_type($i,$conn)];
echo ("field_name (".ingres_field_name($i,$conn).") field_type (INGRES):
".ingres_field_type($i,$conn)." => fieldtype
(MySQL)".$ingres_translation[ingres_field_type($i,$conn)]." <br>");
}
?>
--
http://www.php.net/manual/en/function.ingres-field-type.php
http://master.php.net/manage/user-notes.php?action=edit+20197
http://master.php.net/manage/user-notes.php?action=delete+20197
http://master.php.net/manage/user-notes.php?action=reject+20197