Forums

SQL Statements

tullski 18 Aug, 2008
Hi,

i like to update the cb table comprofiler when a form get submitted.
I am using 1.5 and newest version of cf.
Where i have to put the SQL statement?
When i put it in the autogenerted code, it`s get stripped off after saving.
When i put it in On Submit code - after sending email:
(PHP code with tags)
Nothing gets updated...

I tried the UPDATE statement via myadmin, which works...
<?php
$database = &JFactory::getDBO();
$database->setQuery("UPDATE #__comprofiler SET cb_plz='12345' WHERE user_id='78';");
?>

thx
M
GreyHead 18 Aug, 2008
Hi tullski,

Any of these places should work Ok - but you probably need to add $database->query(); to execute the query.

Bob
tullski 18 Aug, 2008
Bob,

you are right - forget to execute.
Now it`s working with onsubmit.
In Autogenerated code, the php code will get deleted after saving.
Anyway - it`s working.
Thx again.
M
Max_admin 18 Aug, 2008
at BETA 2 you can connect to the CB table and post your user id and it will get updated automatically without writing any SQL!

Cheers

Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
This topic is locked and no more replies can be posted.