TOPIC:

Incrementing record numbers (not id's) from databa 9 years 1 month ago #80459

  • bishopellison's Avatar Topic Author
  • bishopellison
  • Offline
  • Fresh Breezer
  • Fresh Breezer
  • Posts: 7
  • Thanks: 0
I'd like to at the highest record number in my form database, increment it by one and then put it in the record_no textbox of the next form. The MySQL SELECT statement looks like this: SELECT record FROM #_facileforms_subrecords ORDER BY record LIMIT 1;. This should return the highest number in the record fields of the database, which I then want to increment by 1.

My problem is that I can't get the data returned from the SELECT out of PHP (which I used for the query) back into the ff_ElementName_init(element, condition) routine. (ff_record_no_init really) All of the code is in the initscript part of the element.

I hope this makes sense. After several hours I don't think it makes sense to me anymore. Any help would be greatly appreciated.

Thanks,

Bishop Ellison

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

Re: Incrementing record numbers (not id's) from databa 9 years 1 month ago #81490

  • bishopellison's Avatar Topic Author
  • bishopellison
  • Offline
  • Fresh Breezer
  • Fresh Breezer
  • Posts: 7
  • Thanks: 0
Well, I've tried every method I can think of to make this work, but no joy! The final attempt was the following code:

function ff_record_no_init(element, condition)
{
$sql="SELECT value FROM z4hqk_facileforms_subrecords WHERE element = '256' ORDER BY value DESC LIMIT 1";

switch (condition) {
case 'formentry':

if (!function_exists('ff_selectValue')) {
$this->execPieceByName('ff_InitLib');
}
$this->execPieceByName('ff_selectValue');
$value = ff_selectValue($sql);
ff_setValue('element', $value);
break;
default:;
} // switch
} // ff_record_no_init

So far all it does is lockup the form so I can't move to the next page.

The most disappointing part is, even though I paid the hundred bucks for the "pro" version and posted this on the members forum, I get no help - not even a hint.

Oh, well, I'll work on it another week or so and then I'll rip breezing forms out and write the mess in php so I can get info into and out of the database.

Good luck to all...

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

Re: Incrementing record numbers (not id's) from databa 9 years 4 weeks ago #81504

  • bishopellison's Avatar Topic Author
  • bishopellison
  • Offline
  • Fresh Breezer
  • Fresh Breezer
  • Posts: 7
  • Thanks: 0
Problem SOLVED! :cheer:

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

Re: Incrementing record numbers (not id's) from databa 9 years 3 weeks ago #81545

  • djhargrove's Avatar
  • djhargrove
  • Offline
  • Ultimate Breezer
  • Ultimate Breezer
  • Official Support
  • Posts: 3419
  • Thanks: 222

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

Re: Incrementing record numbers (not id's) from databa 9 years 3 weeks ago #81683

  • bishopellison's Avatar Topic Author
  • bishopellison
  • Offline
  • Fresh Breezer
  • Fresh Breezer
  • Posts: 7
  • Thanks: 0
Thanks for the input. That is almost exactly the approach I used that worked. But I had to leave off the <?php and ?> tags to make it work. My code is in the before piece. I don't understand why I had to leave it off and I just stumbled on to that.

Thanks for the info and help,

Bishop

:blush:

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

  • Page:
  • 1
Time to create page: 0.049 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!