TOPIC:

BF : PHP element value calculation (nb record, search nb element value) 8 months 1 week ago #238366

  • Topic Author
  • Gilles361
  • Offline
  • Expert Breezer
  • Expert Breezer
  • Posts: 224
  • Thanks: 5
Hi,
These PHP Element VALUE would help BF beginners who like to count records, or element values, and save some of our time... Also a reminder for me.

// Return number of records of "FormName" form
<?php $db = JFactory::getDBO();
$db->setQuery('Select Count(*) From #__facileforms_records Where name="FormName"');
return $db->loadResult(); ?>

// "Inscription n°" : count nb records+1 of "FormName" form
<?php $db = JFactory::getDBO();
$db->setQuery('Select Count(*) From #__facileforms_records Where name="FormName"');
return $db->loadResult()+1; ?>

// Search for number of EXACT MATCH of "ElementSearch" in "ElementName"
<?php $db = JFactory::getDBO();
$db->setQuery('Select Count(*) From #__facileforms_subrecords Where name="ElementName" and value="ElementSearch"');
return $db->loadResult(); ?>

// Search for number of match of "ElementSearch" value (partial value) in "ElementName"
<?php $db = JFactory::getDBO();
$db->setQuery('Select Count(*) From #__facileforms_subrecords Where name="ElementName" and value LIKE "%ElementSearch%"');
return $db->loadResult(); ?>

// Search for Record ID number (current form) by counting all Breezing Form records (+1)
<?php $db = JFactory::getDBO();
$db->setQuery("Select Max(id) From #__facileforms_records");
return $db->loadResult()+1; ?>

Thanks to Crosstec support,
Gil

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

Last edit: Post by Gilles361.
  • Page:
  • 1
Moderators: ForumSupport
Time to create page: 0.041 seconds

Summer Sale!

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!