I'm trying to setup my own plugin. I followed http://phpcodegenie.sourceforge.net/firstDbPlugin.php Everything worked fine. Then I tried FieldInfo instead of FieldName...
$thisFieldInfoArray = $thisTable->getFieldInfoArray();
// iterate through table for ($f=0;$f<count($thisFieldInfoArray);$f++) { // iterate through fields $fieldInfo = $thisFieldInfoArray[$f]; $code .= ".....Field ".$f." : ". $fieldInfo->getFieldName() . "[" . $fieldInfo->getFieldLength() . "]<br>\n"; }
It didn't work the first time, I had to change the file table.class.php first.
line 136 function initializeFieldsFromDb() I changed: $arrayOfFieldInfos[] = $thisFieldInfo; with $arrayOfFieldInfos[] = clone($thisFieldInfo);
????, I'm running PHP5 ... is there a correlation?
Then, I try to access fieldInfo like length, type etc... I don't get anything... I use mysql and I assume I can access the metadata.
Could someone help me out in this?
Thanks
Log in to post a comment.
I'm trying to setup my own plugin.
I followed http://phpcodegenie.sourceforge.net/firstDbPlugin.php
Everything worked fine.
Then I tried FieldInfo instead of FieldName...
$thisFieldInfoArray = $thisTable->getFieldInfoArray();
// iterate through table
for ($f=0;$f<count($thisFieldInfoArray);$f++)
{
// iterate through fields
$fieldInfo = $thisFieldInfoArray[$f];
$code .= ".....Field ".$f." : ". $fieldInfo->getFieldName() . "[" . $fieldInfo->getFieldLength() . "]<br>\n";
}
It didn't work the first time, I had to change the file table.class.php first.
line 136 function initializeFieldsFromDb()
I changed:
$arrayOfFieldInfos[] = $thisFieldInfo;
with
$arrayOfFieldInfos[] = clone($thisFieldInfo);
????, I'm running PHP5 ... is there a correlation?
Then, I try to access fieldInfo like length, type etc...
I don't get anything...
I use mysql and I assume I can access the metadata.
Could someone help me out in this?
Thanks