Blank Field Values

From: Date: Fri, 18 May 2001 17:05:04 +0000
Subject: Blank Field Values
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-53456@lists.php.net to get a copy of this message
OK. Ive been beating my head over this code for a bit. I would appreciate it if a fresh set of eyes would take a look at this for me. I have the following code; <SCRIPT language="PHP"> $connection = odbc_pconnect("XXXXXXX","XXXXX","XXXXXXX"); $SQL = "SELECT * FROM Bios WHERE CharacterName = '"; $SQL .= $CharacterName; $SQL .= "'"; $QueryResult = odbc_do($connection, $SQL); $NumberofRows = odbc_num_rows($QueryResult); $ID = odbc_result($QueryResult, ID); $NumberofFields = odbc_num_fields($QueryResult); if ($NumberofRows != 0) { $counter = 1; do { $CurrentFieldName = odbc_field_name($QueryResult, $counter); $CurrentFieldValue = odbc_result($QueryResult, $CurrentFieldName); echo $CurrentFieldName; echo "="; echo $CurrentFieldValue; echo ","; $counter = $counter + 1; } while ($counter <= $NumberofFields); echo "endoffields=end"; } else { echo "No records for that character"; } </SCRIPT> It results in the following output; ID=,CharacterName=,RealName=,FormerAlias=,CurrentAlias=,FormerOccupations=,C urrentOccupation=,MilitaryExperience=,Education=,LegalStatus=,Identity=,Plac eofOrigin=,MaritalStatus=,KnownRelatives=,KnownConfidants=,Pets=,KnownAllies =,MajorEnemies=,BaseofOperations=,Transportation=,PastGroupAffiliates=,Curre ntGroupAffiliates=,Income=,Height=,Weight=,EyeColor=,HairColor=,OtherFeature s=,IntelligenceLevel=,Strength=,SpeedReactions=,Stamina=,Agility=,FightingSk ills=,SpecialSkills=,Handicaps=,OtherPowersandSkills=,Background=,endoffield s=end If I run the query with Access, it comes up with the expected row of information I'm looking for. Can anyone see why Im getting empty values back? Any help would be GREATLY appreciated. Jeff Pearson

« previous php.general (#53456) next »