Forums

DB record load/save - sql search

deckg 09 May, 2012
Hi,
I've created a from that pulls data from a database ok, but now need to populate a form by a different method.
I want to use two parameters to populate the form, one called email and one called page.
The sql search for this would be

$query = "SELECT * FROM $DATABASE.$TABLE WHERE email = '$email' AND page = '$page'";

I see that there is the option under the advanced tab to enter an sql statement, so I entered
"email = 'email' AND page = 'page' but it does not appear to be working.
How can I save to the db using these parameters as well?

I can sit down and write the php but prefer to use chronofomrms!

Many thanks for your help,
All the best,
Derek
Max_admin 11 May, 2012
Hi Derek,

How do you get the "page" and "email" values ? are they dynamic ?

Regards,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
deckg 11 May, 2012
Hi,
They are collected from the url via $_GET

Cheers,
Derek
GreyHead 12 May, 2012
Hi Derek,

ChronoForms will load the $_GET and $_POST arrays into the $form->data array so you can use
$query = "
  SELECT * 
    FROM $DATABASE.$TABLE 
    WHERE `email` = '{$form->data['email']}' AND `page` = '{$form->data['page']}' ;
";


Bob
This topic is locked and no more replies can be posted.