TOPIC:

Project BREEZINGFORM+ CONTENTBUILDER. 2 months 1 week ago #251994

  • Topic Author
  • DAVIDPL
  • Offline
  • Senior Breezer
  • Senior Breezer
  • Posts: 110
  • Thanks: 0
I have already been able to perform this function

I would now need to be able to enter an ADDITIONAL condition in the Federated (value) field

Code: Federado en value

<?php $db = JFactory::getDbo(); $db->setQuery("Select max(id) From #__deportistas Where seleccion = 'Si'"); return $db->loadResult();?>

condition ADDIOTIONAL = Value del campo usuario

<?php $user = JFactory::getUser(); return $user->get('username'); ?>


Tests
they do not work
<?php $db = JFactory::getDbo(); $db->setQuery("Select max(id) From #__deportistas Where seleccion = 'Si' AND dirclub = $value(JFactory::getUser()->get('username'));"); return $db->loadResult();?>

Tests
they do not work

<?php $db = JFactory::getDbo(); $db->setQuery("Select max(id) From #__deportistas Where seleccion = 'Si' AND dirclub = $value = JFactory::getUser()->get('username', ''); return $db->loadResult();?>

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

Project BREEZINGFORM+ CONTENTBUILDER. 2 months 1 week ago #252005

  • tihana.krivic's Avatar
  • tihana.krivic
  • Offline
  • Moderator
  • Moderator
  • Posts: 3824
  • Karma: 3
  • Thanks: 304
Hi,

like this:
<?php $db = JFactory::getDbo(); $db->setQuery("Select max(id) From #__deportistas Where seleccion = 'Si' AND dirclub  = JFactory::getUser()->get('username', ''); return $db->loadResult();?>
Where did you put this code?

Regards,
Tihana

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

Project BREEZINGFORM+ CONTENTBUILDER. 2 months 1 week ago #252026

  • Topic Author
  • DAVIDPL
  • Offline
  • Senior Breezer
  • Senior Breezer
  • Posts: 110
  • Thanks: 0
Hi

The code does not work

Cheers

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

Project BREEZINGFORM+ CONTENTBUILDER. 2 months 1 week ago #252028

  • tihana.krivic's Avatar
  • tihana.krivic
  • Offline
  • Moderator
  • Moderator
  • Posts: 3824
  • Karma: 3
  • Thanks: 304
Hi,

is it work this:
<?php $db = JFactory::getDbo(); $db->setQuery("Select max(id) From #__deportistas Where seleccion = 'Si' ; return $db->loadResult();?>
Did you put this code in item wrap code?

Regards,
Tihana

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

Project BREEZINGFORM+ CONTENTBUILDER. 2 months 1 week ago #252039

  • Topic Author
  • DAVIDPL
  • Offline
  • Senior Breezer
  • Senior Breezer
  • Posts: 110
  • Thanks: 0
Hi

These two codes work fine


the first with one condition and

code:
<?php $db = JFactory::getDbo(); $db->setQuery("Select max(id_federado) From #__deportistas Where seleccion ='Si'"); return $db->loadResult();?>


the second with two conditions.


form field: username= club001

code:
<?php $db = JFactory::getDbo(); $db->setQuery("Select max(id_federado) From #__deportistas Where seleccion = 'Si' AND dirclub = 'club001'"); return $db->loadResult();?>



I want to put the value of the username form field in the code

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

Project BREEZINGFORM+ CONTENTBUILDER. 2 months 1 week ago #252045

  • tihana.krivic's Avatar
  • tihana.krivic
  • Offline
  • Moderator
  • Moderator
  • Posts: 3824
  • Karma: 3
  • Thanks: 304
Hi,

please test this:
<?php $username=JFactory::getUser()->get('username', ''); $db = JFactory::getDbo(); $db->setQuery("Select max(id) From #__deportistas Where seleccion = 'Si'
 AND dirclub = $username; return $db->loadResult();?>

Regards,
Tihana

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

Moderators: ForumSupport
Time to create page: 0.050 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!