I'm having trouble getting the Show data from master table in add, edit or view page to work.
My master table is:
owners
Key field is:
owner_ID
And I wish to show data from field
currency
in a add new page which adds data to table
DealerListings.
In dealer listings the foreign key is
owner_ID
Here is the snipped code I'm using as provided in the help section.
global $dal, $strTableName;
echo "Master Info:
";
if ($_SESSION[$strTableName."_masterkey1"])
{
$tblMaster = $dal->Table("owners");
$rs = $tblMaster->Query("owner_ID=".$_SESSION[$strTableName."_masterkey1"],"");
if ($data = db_fetch_array($rs))
{
echo "Currency: ".$data["currency"]."
";
echo "Phone: ".$data["phone1"]."
";
}
}
The problem is the data from the field currency and phone1 does not show.
There is no error, I just don't get the desired result.
Only the words Master info: show where I have placed the snippet but not the data from the resource.
I placed the sippet in a add new page.
I hope someone can give me some hints with this. I have tried everything and am at my wits end.
Many thanks to the kind person who can help me over this hurdle.
Rene