Hi Lapo,
Yes, you can. See the INSERT . . . SET . . . VALUES . . . syntax in the MySQL manual for the way to write the query
Bob
Yes, you can. See the INSERT . . . SET . . . VALUES . . . syntax in the MySQL manual for the way to write the query
Bob
Thanks, Can I enter the query using php by submit? If yes, i use the "Custom Code" OnSubmit? Thanks
SOLVED!!!
<?php
$input_1 = $form->data['input_1'];
$other_input_1 = $form->data['other_input_1'];
$input_2 = $form->data['input_2'];
$other_input_2 = $form->data['other_input_2'];
$db =& JFactory::getDBO();
$query = "INSERT INTO table_name (field_a, field_b) VALUES ('$input_1','$other_input_1'),('$input_2','$other_input_2');";
$db->setQuery($query);
$db->query();
$id = $db->insertid();
?>
This topic is locked and no more replies can be posted.
