Hello all
I have been using chronoforms to build a simple membership database and now it's time for the members to renew their memberships. I wish to make it possible for the members to get the registred data on request, by entering their email adress and the year of birth into a form.
Like this:
Form
Enter email:
Enter year of birth:
Send me an email ->
Email
Your details from our database:
Member number (cf_id):
Name:
Adress:
Phone:
etc...
I've tried a simple mysql request, but it doesnt work
I have been using chronoforms to build a simple membership database and now it's time for the members to renew their memberships. I wish to make it possible for the members to get the registred data on request, by entering their email adress and the year of birth into a form.
Like this:
Form
Enter email:
Enter year of birth:
Send me an email ->
Your details from our database:
Member number (cf_id):
Name:
Adress:
Phone:
etc...
I've tried a simple mysql request, but it doesnt work
mysql_query("SELECT * FROM jos_chronoforms_database WHERE email = '{email}' AND year = '{year}' LIMIT 1");
I think because the script runs before chronoform replaces the tags? Anyways, if anyone can help me out it would be much appreciated!🙂
Hi alltidblaa ,
You can use the DB Record Loader action in CFv4 or the Profile Page plug-in in CFv3 to re-load data from a database record into a form.
Bob
You can use the DB Record Loader action in CFv4 or the Profile Page plug-in in CFv3 to re-load data from a database record into a form.
Bob
Thanks for your reply, Grey.
I've tested the Profile Page plug-in now. The problem is I want the data from the database only to be visible in the email, and not in the form. Also, as there are some members with the same email adress (parent and children etc) I will need to use both the email adress and the year of birth to single out one row in the database.
I should also explain that the members do not have user accounts on the website, so this "information on request"-form will be publicly available. Hence, I can't publish the database data in the form, but only in the email.
Is there any other way? (keep in mind i have not tried V4 and Record Loader...)
I've tested the Profile Page plug-in now. The problem is I want the data from the database only to be visible in the email, and not in the form. Also, as there are some members with the same email adress (parent and children etc) I will need to use both the email adress and the year of birth to single out one row in the database.
I should also explain that the members do not have user accounts on the website, so this "information on request"-form will be publicly available. Hence, I can't publish the database data in the form, but only in the email.
Is there any other way? (keep in mind i have not tried V4 and Record Loader...)
Sorry for calling you Grey, Bob. You're not grey at all!
Anyways, if you can help me I will definitely buy you a big, delicious beer!
I imagine it shouldn't be so tricky. Maby a $emailadr = $form->data['email']; or something would do it?
Anyways, if you can help me I will definitely buy you a big, delicious beer!
I imagine it shouldn't be so tricky. Maby a $emailadr = $form->data['email']; or something would do it?
Okey, you have no idea how proud I am right now. I fixed it all by myself! (that's a stinking lie, I browsed this forum for hours and put together bits and pieces. Still got it to work, tho...)
If anyone is curious to how i did it, i put this in the email:
Still gonna buy you a beer, Bob.🙂
If anyone is curious to how i did it, i put this in the email:
<?php
$mailz = $MyForm->tablerow["#__newtable"]->mail;
$yearz = $MyForm->tablerow["#__newtable"]->fodselsaars;
$result = mysql_query("SELECT * FROM #__membertable WHERE mail = '{$mailz}' AND year = '{$yearz}' LIMIT 1");
while($row = mysql_fetch_array($result))
{
$cf_id = $row['cf_id'];
$name = $row['name'];
(...etc...)
}
echo "<strong>Number: $cf_id </strong>
<br>Name: $name
<br>(...etc...)" ;
?>
</p>
Still gonna buy you a beer, Bob.🙂
This topic is locked and no more replies can be posted.