I followed this post but it is still not inserting into the table. I have been struggling to get the correct syntax and would appreciate any help.
I have also tried to skip inserting a NULL into the key as follows:
Also, I have to insert array values into one of the fields in another table. How do I place the following into the sytax for SQL:
$db = &JFactory::getDBO();
$query = "INSERT INTO table_name (id, name, start, end, publish, discount_type, amount, code, limit, events_enable) VALUES (NULL,'$name', '$start', '$end', '1', '2', '100.00', '$code', '0', '0');";
$db->setQuery($query);
$db->query();
I have also tried to skip inserting a NULL into the key as follows:
$db = &JFactory::getDBO();
$query = "INSERT INTO table_name (name, start, end, publish, discount_type, amount, code, limit, events_enable) VALUES ('$name', '$start', '$end', '1', '2', '100.00', '$code', '0', '0');";
$db->setQuery($query);
$db->query();
Also, I have to insert array values into one of the fields in another table. How do I place the following into the sytax for SQL:
{"range":"all","range2":"first","amount_left":0,"msc_ids":"2","currencies":"USD"}
?