Hi Alexandra,
First thank you for your reply. It was very helpful but I still have a question. I would like to use either of the following code snippet examples from the documentation:
$id = $connector->insert(array(
"type" => "simple",
));
This appears to be PHP code and I put it in a PHP file as follows:
<?php
require_once('config.php');
$id = $connector->insert(array(
"Company_Name,Address1,Address2,Phone,Fax,
Email,Website,Promo,About_Us,Directions,Show_Visible,Featured,Tier2,Tier3" => "Company_Name,Address1,Address2,Phone,Fax,
Email,Website,Promo,About_Us,Directions,Show_Visible,Featured,Tier2,Tier3",
));
?>
Or
$connector->sql->query("INSERT INTO some_table(type) VALUES('simple')");
$id = $connector->sql->get_new_id();
I also put this into a PHP file named data_insert.php:
<?php
require_once('config.php');
$connector->sql->query("INSERT INTO Company(Company_Name,Address1,Address2,Phone,Fax,
Email,Website,Promo,About_Us,Directions,Show_Visible,Featured,Tier2,Tier3)
VALUES('Company_Name,Address1,Address2,Phone,Fax,
Email,Website,Promo,About_Us,Directions,Show_Visible,Featured,Tier2,Tier3')");
$id = $connector->sql->get_new_id();
?>
My first question, is my code correct?
Second question, how would I call this function on the client side?
I have on the client side the following code connected to a “Add”,“Update” and “Delete” buttons:
<script type="text/javascript">
function DataInsert()
function DataUpdate() {
dp.sendData();
}
function DataDelete()
</script>
As you can see only the update function works. If you could give me an example of how I would call the “Insert” and “Delete” functions that would be great. Thank you, your assistance is greatly appreciated!
Best Regards,
Joe