This topic is locked

Trying to use DAL function on listpage

2/18/2016 2:44:39 PM
PHPRunner General questions
S
snuffi01 author

Hi,

Im trying to do an lookup from table in another database on an listpage.

On my listpage i have one field called CFAlways, in another database (with is "connection primary" in the PHPrunner project) i have an table called "reseller_external_numbers".

I want to do an lookup where the CFAlways = Externt_nummer (ID field in table "reseller_external_numbers") and then show the field "Bild"
My code so far:



global $dal;
$tblUsers = $dal->Table(reseller_external_numbers);
$tblUsers->Param["Externt_nummer"]=$data["CFAlways"];
$rs = $tblUsers->FetchByID();
while( $data = db_fetch_array($rs) )
{
echo $data["Bild"];
}


My problem is that i get this when trying the site:

Fatal error: Call to undefined method stdClass::FetchByID()

Sergey Kornilov admin 2/18/2016

The following looks like an error to me:

$tblUsers = $dal->Table(reseller_external_numbers);


Should be this way:

$tblUsers = $dal->Table("reseller_external_numbers");
S
snuffi01 author 2/19/2016



The following looks like an error to me:

$tblUsers = $dal->Table(reseller_external_numbers);


Should be this way:

$tblUsers = $dal->Table("reseller_external_numbers");



Hi,
Have chnged this row as you pointed, but still get the error message:

Fatal error: Call to undefined method stdClass::FetchByID()

(I'm using this code in an "PHP Code snippet" on listpage)
/ Kristian

Sergey Kornilov admin 2/19/2016

Probably there some other errors there, cannot tell by just looking at the code.
If you have a support contract upload your project to Demo Account and open a ticket with support sending Demo Account URL along with instructions on reproducing the issue.