Ive been trying to create a form that save the info in my database… sounds pretty easy but I have messy documentation (or I am not so smart), I just want to send some parameters on my submit, in the other side catch them and save some info at the database….
So, I did this:
in my component/views/myview/tmpl/default.php I wrote this:
<form action="index.php">
<input type="submit" value="test" />
</form>
Then, I went to my file view.html.php on /mycomponent/view/component/view.html and I do this:
$this->get('SaveClient');
and in my model I did this (only for trying):
public function getSaveClient(){
$query ="
Insert into client ( `id_client` ,`test`)
VALUES
(NULL , '1')
";
$db = & JFactory::getDBO();
$db->Execute($query);
}
But still.. doesnt work, any idea how to make it work??
Thanks!
You haven’t defined the table name correctly. It should be
#__tablename. Once you have tried this and it still doesn’t work, try using the following code below instead.