TOPIC:

Please check my code. To save data form to an other table. 3 weeks 2 days ago #250420

  • Topic Author
  • vagabe
  • Offline
  • Fresh Breezer
  • Fresh Breezer
  • Posts: 7
  • Thanks: 0
Hello.
I made a form. All ok.
I need save data form in personal table. I create.

In Form - Avanced - more option - Submite Pieces - End Submit - Custom

I add code:

function ff_take(element)
{
ff_query("insert into pstpba(pstcodigo) values ('".ff_getSubmit('pscodigo')."')";
} //ff_take

My table is: pstpba
the field: pstcodigo
I wish save value pscodigo from form to my table.

Question:
- I put code in correct place?
- The code is ok?

*************************************
Other questions:
- BreezingForms : Pices (The functions are examples?)
- There are any place in documentation where a can know breezing code development
You do not have permissions to access this page.
?
Attachments:

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

Last edit: Post by vagabe.

Please check my code. To save data form to an other table. 3 weeks 2 days ago #250437

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

1) okay, you can set this code in End Submit piece but here you should php code. Your code is not ok.
Here you can find example for code:
docs.joomla.org/Inserting,_Updating_and_...data_using_JDatabase

You should to customize it to yourself.

2) if I understood you correctly, then script and pieces are used if you need to add custom functionality to your form.
crosstec.org/en/support/online-documenta...ript-and-pieces.html

Regards,
Tihana

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

Last edit: Post by tihana.krivic.

Are there BreezingForms: Integrador For Wordpress? 3 weeks 1 day ago #250459

  • Topic Author
  • vagabe
  • Offline
  • Fresh Breezer
  • Fresh Breezer
  • Posts: 7
  • Thanks: 0
Hello Tihana
Are there BreezingForms: Integrador For Wordpress? This solve my need.

The reference that you give me are for Joomla... I belive the code is similar for wordpress, but i'm not sure.

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

Please check my code. To save data form to an other table. 3 weeks 1 day ago #250460

  • Topic Author
  • vagabe
  • Offline
  • Fresh Breezer
  • Fresh Breezer
  • Posts: 7
  • Thanks: 0
I put this code, but not save in the table. Do you see the mistake:
My table is: pstpba
the field: pstcodigo
I wish save value pscodigo from form to my table.
*****************************************************
Put this in Submite pices - End Submit
$this->execPieceByName('ff_InitLib');
$db = JFactory::getDbo();

$db->setQuery("INSERT into `pstpba` (`pstcodigo`) VALUES(".ff_getSubmit('pscodigo').")");
$db->execute();

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

Please check my code. To save data form to an other table. 2 weeks 6 days ago #250476

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

this should be something like this:
$db = JFactory::getDbo();
$query = $db->getQuery(true);
$val=ff_getSubmit('pscodigo');
$columns=array('pstcodigo');
$query
    ->insert($db->quoteName('pstpba'))
    ->columns($db->quoteName($columns))
    ->values(implode($val));

$db->setQuery($query);
$db->execute();

Please check name of this table in your phpmyadmin->make sure that name of table is pstpba and name of columns is pstcodigo

Regards,
Tihana

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

Please check my code. To save data form to an other table. 2 weeks 5 days ago #250508

  • Topic Author
  • vagabe
  • Offline
  • Fresh Breezer
  • Fresh Breezer
  • Posts: 7
  • Thanks: 0
Thanks Tihana
I put code. But not save pstcodigo in pstpba table. I donk find the reason.

In the table pstpba the fiel pstcodigo is integer. Do you belive, is it the reason?

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

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