Quantcast
Channel: ASPRunner forums
Viewing all articles
Browse latest Browse all 2586

Inserting into another table

$
0
0
I would like to add the id of the record I'm adding to a field in another table but am not getting any joy is this the correct way to do it? I've tried 2 ways to do it without any luck

global $dal;
$tblEvents = $dal->Table("Property_Landlord_Tenant_Link");
$tblEvents->Value["PLT_P_id"]=$values['P_id'];
$tblEvents->Add();

$sql = "INSERT INTO Property_Landlord_Tenant_Link (PLT_P_id) values ($values[P_id])";
CustomQuery($sql);

Any ideas?

I can add it when done through phpadmin using a hard-coded value

Viewing all articles
Browse latest Browse all 2586

Trending Articles