[FX.php List] Notice: Undefined index
Steve Winter
steve at bluecrocodile.co.nz
Thu Oct 21 19:28:54 MDT 2004
One thing I find useful to do in this situation is to do a print_r of the
data which is returned, which will show the actual index names of your
array... if you insert;
echo "<pre>";
print_r($InstanceResult['data']);
echo "</pre>";
after the line
> echo $InstanceResult['errorCode'];
in your code, then comment out the entire 'for' code block, you'll get
both the keys and the values of 'data' displayed which will let you verify
that 'Project codes' in whichever combination of caps it might be in, is
included in the found data...
Hope this helps...
Steve
-----Original Message-----
From: "philippe rouleau" <prouleau at grouped3.com>
To: <fx.php_list at mail.iviking.org>
Date: Thu, 21 Oct 2004 18:24:58 -0400
Subject: [FX.php List] Notice: Undefined index
> I Have a field Called "Project Code" that is on the layout that is
> defined in PHP ($InstanceName->setDBData('condos_.fp5','Liste de Prix
> des Condos Copy',100);) , I have a problem when I want to display it
> using the following :
>
> echo $InstanceData['Project code'][0];
>
> I get a message "Notice: Undefined index: Project code in C:\Program
> Files\Apache Group\Apache2\htdocs\form4.php on line 30".
>
> All the other field I'm using are working OK. I verified that "Project
> code" is written exactly the same with the small cap on the "c" of
> code.
>
> Is there a something that I'm missing ?
>
> Here is the total php code
>
> <?php
> $color = "blue and VIAU" ;
> $color_two=$color ;
> echo $color_two ;
> include_once("fx/fx.php");
> include_once("fx/server_data.php");
> include_once("fx/FMErrors.php");
> include_once("header.php");
> $InstanceName=new FX($serverIP,$webCompanionPort);
> $InstanceName->SetDBPassword('0rf0rd');
>
> $InstanceName->setDBData('condos_.fp5','Liste de Prix des Condos
> Copy',100);
>
> $projectcode = "chevalier";
> $InstanceName->AddDBParam('project code', $projectcode);
>
>
> $InstanceResult = $InstanceName->FMFind();
> echo $InstanceResult['foundCount'];
> echo $InstanceResult['errorCode'];
> foreach ($InstanceResult['data'] as $key => $InstanceData)
> {
> ?>
> Condo :
> <?php
> echo $InstanceData['Condo'][0];
> ?>
> Statut :
> <?php
> echo $InstanceData['Project code'][0];
> ?>
> Prix Vendus :
> <?php
> echo $InstanceData['Prix Vendu Condo'][0];
> ?>
> <br>
> <?php
> }
> ?>
>
>
> Thanks in Advance
>
More information about the FX.php_List
mailing list