TOPIC:

Usergroup or another DB data in a field 2 years 2 months ago #228914

  • MarioPuco's Avatar Topic Author
  • MarioPuco
  • Offline
  • Ultimate Breezer
  • Ultimate Breezer
  • Posts: 5958
  • Karma: 119
  • Thanks: 554
Hi,

Here is the query :
<?php 
$user_id = JFactory::getUser()->id;
$db = JFactory::getDbo();
$db->setQuery("SELECT id FROM #__facileforms_records WHERE user_id = $user_id");
$record_id = $db->loadResult();
$db->setQuery("SELECT value from #__facileforms_subrecords WHERE element = 4 AND record = $record_id");
$date_of_birth = $db->loadResult();

return $date_of_birth;
?>

Hope this is what you wanted.

Regards,
Mario

Please Log in or Create an account to join the conversation.

Usergroup or another DB data in a field 2 years 2 months ago #228920

  • Eddy.vh's Avatar
  • Eddy.vh
  • Offline
  • Gold Breezer
  • Gold Breezer
  • Posts: 424
  • Karma: 4
  • Thanks: 69
Hello Mario.

I thank you for this request that I will try today.
I will come back to tell you if I could use it.

Have a nice day.
The following user(s) said Thank You: MarioPuco

Please Log in or Create an account to join the conversation.

Usergroup or another DB data in a field 2 years 2 months ago #228925

  • Eddy.vh's Avatar
  • Eddy.vh
  • Offline
  • Gold Breezer
  • Gold Breezer
  • Posts: 424
  • Karma: 4
  • Thanks: 69
Mario.

Unfortunately it returns me an error. I see this code on my foprmulaire test, it seems that you tested. Did it work?

The error:
1064
You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax

I searched a little but can not find anything to solve.

Please Log in or Create an account to join the conversation.

Usergroup or another DB data in a field 2 years 2 months ago #228926

  • MarioPuco's Avatar Topic Author
  • MarioPuco
  • Offline
  • Ultimate Breezer
  • Ultimate Breezer
  • Posts: 5958
  • Karma: 119
  • Thanks: 554
Hello,

Please try the code now
<?php 
$user_id = JFactory::getUser()->id;
$db = JFactory::getDbo();
$db->setQuery("SELECT id FROM #__facileforms_records WHERE user_id = $user_id");
$record_id = $db->loadResult();
$db->setQuery("SELECT value from #__facileforms_subrecords WHERE element = 4 AND record = $record_id");
$date_of_birth = $db->loadResult();
return $date_of_birth;
?>

Regards,
Mario

Please Log in or Create an account to join the conversation.

Usergroup or another DB data in a field 2 years 2 months ago #228938

  • Eddy.vh's Avatar
  • Eddy.vh
  • Offline
  • Gold Breezer
  • Gold Breezer
  • Posts: 424
  • Karma: 4
  • Thanks: 69
Dear Mario.

It does not work, always the same mistake. There is no difference between the two queries except for a blank line in the first one.
__
Eddy

Please Log in or Create an account to join the conversation.

Usergroup or another DB data in a field 2 years 2 months ago #228939

  • MarioPuco's Avatar Topic Author
  • MarioPuco
  • Offline
  • Ultimate Breezer
  • Ultimate Breezer
  • Posts: 5958
  • Karma: 119
  • Thanks: 554
Hi,



It works well for me.

Rgds,
Mario
Attachments:

Please Log in or Create an account to join the conversation.

Moderators: ForumSupport
Time to create page: 0.089 seconds

BreezingForms Pro 1.4.7 for WordPress Released!

Available in the membership section.

September Discount!

Massive discounts on all subscriptions!

Get Your Subscription Here

Quick Links

Downloads

BreezingForms

ContentBuilder

BreezingCommerce

Templates

Documentation

BreezingForms

ContentBuilder

BreezingCommerce

Apprendre BreezingForms (French Community)

Apprendre et maîtriser BreezingForms par des tutoriels et exemples, le tout en français

breezingforms.eddy-vh.com

Questions et réponses sur les forums de l'AFUJ

AFUJ

Special Offer

Summer Sale! All subscriptions at a special price!

Includes prio support, all of our current and future Joomla!® extensions and Joomla!® templates for the duration of your membership.

Get it from here

3rd Party Discount - 25% Off

We help you to keep your costs under control. If you are a new member and purchased a form building tool from a different form vendor, then you'll get a 25% discount on our subscription plans.

How to receive the discount:

Send us a quick email to sales@crosstec.org with a proof of purchase (for example a paypal receipt), await payment instructions and enjoy your membership!