Truncated key in Asso array created by ADODB recordset
Posted: Sat Feb 20, 2010 6:52 pm
I have pulled in a record from a database as an associative array with the field name as the key.
However it is trucating the key... the field name. It is of legal length in Access where I draw it from (Less that 50 char in fact)
I have a field name of
Client_Month_End_Report_Template
it puts
Client_Month_End_Report_Templat
and
Client_Per_Item_Convenience_Charge
is
Client_Per_Item_Convenience_Cha
CODE:
include_once "includes/setErrorHandling.php";
$dbName="BIPS"; // Broadcast invoice payment system
$db =& ADONewConnection('access');
$db->SetFetchMode(ADODB_FETCH_ASSOC);
// $db->debug=true;
$dsn = "Driver={Microsoft Access Driver (*.mdb)};Dbq=G:\web\PPBSites\bcastpayCom\database\\" . $dbName . ".mdb;Uid=;Pwd=;";
// print $dsn . "\n";
$db->Connect($dsn);
$query = "SELECT * FROM Client_Cfg_Table WHERE Client_Id = 1";
// print $query;
$res = $db->getRow($query);
print_r($res);
$printer="Y";
foreach($res as $key => $myVal)
{
if($key == "AAAAA"){$printer="N";} // Don't display DB below this field
if($printer=="Y"){echo "var " . $key . " = \"" . $myVal . "\";\n<br>";}
$i = $i + 1;
}
Most puzzling...
Thanks in advance!
Parham "deepedge" Baker
However it is trucating the key... the field name. It is of legal length in Access where I draw it from (Less that 50 char in fact)
I have a field name of
Client_Month_End_Report_Template
it puts
Client_Month_End_Report_Templat
and
Client_Per_Item_Convenience_Charge
is
Client_Per_Item_Convenience_Cha
CODE:
include_once "includes/setErrorHandling.php";
$dbName="BIPS"; // Broadcast invoice payment system
$db =& ADONewConnection('access');
$db->SetFetchMode(ADODB_FETCH_ASSOC);
// $db->debug=true;
$dsn = "Driver={Microsoft Access Driver (*.mdb)};Dbq=G:\web\PPBSites\bcastpayCom\database\\" . $dbName . ".mdb;Uid=;Pwd=;";
// print $dsn . "\n";
$db->Connect($dsn);
$query = "SELECT * FROM Client_Cfg_Table WHERE Client_Id = 1";
// print $query;
$res = $db->getRow($query);
print_r($res);
$printer="Y";
foreach($res as $key => $myVal)
{
if($key == "AAAAA"){$printer="N";} // Don't display DB below this field
if($printer=="Y"){echo "var " . $key . " = \"" . $myVal . "\";\n<br>";}
$i = $i + 1;
}
Most puzzling...
Thanks in advance!
Parham "deepedge" Baker