Forums
This topic is locked
Big problem with NULL field values and ADODB/Phakt
Posted 01 Nov 2001 13:06:21
1
has voted
01 Nov 2001 13:06:21 Paul Groves posted:
Hi I'm using Ultradev with Phakt 1.06/ADODB 1.40I'm not sure if I'm missing something, but ADODB seems to have a big problem when it encounters a field which has a value NULL.
An example - I want to display the prefix (e.g. Dr., Prof. etc.) and the name of people (where the prefix is a seperate field in the MySQL 3.23 database I'm retrieving the information from).
So the code I'm using is:
echo $PartDetail->Fields("prefix"
echo $PartDetail->Fields("first_name"
echo $PartDetail->Fields("last_name"
If a particular record has values for all these fields, all is well and the information displays correctly
However, not everyone uses a prefix, so this is often a NULL value. When this happens I get the error:
"Warning: Undefined index: prefix in D:\Inetpub\wwwroot\projects\adodb\adodb.inc.php on line 1363"
The line in question is:
return $this->fields[$colname];
If it was just a question of checking for a NULL value etc in my code before displaying, that wouldn't be a problem - but even trying to check the value of $PartDetail->Fields("prefix" throws up this error!
How are you meant to deal with NULL value fields in Phakt/ADODB? The only way I can see to do it would be to edit the ADODB code, but that can't be right
Any help would be very much appreciated!
cheers
Paul