Hi,
just made my first form.
Like thc cb_profile, which display all the field data.
Is there a way, if a user make changes to the fields and hit the submit button, that the changes will automatically update the #__comprofiler table?
I tried
i enterd this code in the
On Submit code - before sending email:
(PHP code with tags)
No error - no changes in the db?
What im doing wrong?
thx
t
just made my first form.
Like thc cb_profile, which display all the field data.
Is there a way, if a user make changes to the fields and hit the submit button, that the changes will automatically update the #__comprofiler table?
I tried
<?php
$user =& JFactory::getUser();
$db =&JFactory::getDBO();
$database->setQuery( "INSERT * INTO #__comprofiler WHERE user_id = ".$user->get('id'));
if (!$database->query()) {
echo "<script> alert('".$database->getErrorMsg()."'); window.history.go(-1); </script>";
}
?>
i enterd this code in the
On Submit code - before sending email:
(PHP code with tags)
No error - no changes in the db?
What im doing wrong?
thx
t
Hi tullski,
Sorry but the query used is wrong of course!
you need to check if there was changes made or not, depends on your requirements but then you need to update one record existing, look at the forums for UPDATE statements and not INSERT statements
Cheers
Max
Sorry but the query used is wrong of course!
you need to check if there was changes made or not, depends on your requirements but then you need to update one record existing, look at the forums for UPDATE statements and not INSERT statements
Cheers
Max
This topic is locked and no more replies can be posted.