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

Inserting a record into another table

$
0
0
Hello...

I'm a new PHPrunner user working on a order taking/tracking app for a local non-profit organization and I'm stuck. I'm trying to insert a record into another table from the client edit page, into the orders table using a custom button server event. I've tried using examples found in the manual, examples from support and I simply can't get them to work. Here are the two code snippets:

// Insert a record into table
$data = array();
$data["firstname"] = firstname;
$data["middlename"] = middlename;
$data["lastname"] = lastname;
DB::Insert("orders", $data );

This code does nothing, no record is added, nor do I get any errors using chrome developers debugger. I also tried:

global $dal;

$data = $dal->Table("orders");

$data->firstname = $record["firstname"];
$data->middlename = $record["middlename"];
$data->lastname = $record["lastname"];

$data->Add();

I have the same exact results as the above sample. I would very much appreciate any insight to whats going on.

Thanks,

- Steven

Viewing all articles
Browse latest Browse all 2586

Trending Articles