Code

Discussion on Gravity Forms - WPDB / MySQL Connect

Discussion on Gravity Forms - WPDB / MySQL Connect

Cart 844 sales
naranili

naranili supports this item

Supported

This author's response time can be up to 5 business days.

191 comments found.

hello persale question: is it possible to connect to another database, stored on the same webserver but database different from wordpress database?

No. This isn’t possible.

We have the same issue as “worldserve” a few hours ago.

As you can see from the comments, i respond to your messages.

Ja, Ralf. Deine kurzen Rückfragen sind meist jedoch nicht sehr zielführend, da ich schon zu Beginn erwähnt habe, dass ich exakt nach der Dokumentation gearbeitet habe und es so nicht funktioniert. Ich hoffe wir finden jetzt mit dem Admin-Zugang eine Lösung. Es würde uns freuen, wenn wir diese super Funktionalitäten des Plugins auch nutzen können :-)

Sollte jetzt klappen

I have a conflict between gravity forms 2.4.1 and this plugin v3.5. Each time I save a form, it automatically turns the GF form inactive and disables it. When I disable wpdb-mysql-connect v3.5, gravity forms saves/works properly.

Hm. For other users it works.

/** Class Name: SP Gravity Forms WPDB Connect Class URI: http://specialpress.de/plugins/spgfwpdb Description: Connect Gravity Forms to the WPDB MySQL Database Version: 3.5.0 Date: 2018/11/03 Author: Ralf Fuhrmann Author URI: http://naranili.de */ I had understood it was updating to version 3.5.1… so just pointing out the version/date. I just downloaded again to double check – old version and date for some reason??

As mentioned, the update works now (not disabling forms).

Sounds good

im looking for a solution to how im using gravity form.

I uses gravity form for event registration. There is nested form within a form. So the database can very very messy.

I was thinking to create a database for each event signup. then I can organize them properly and call any data I need. like how many shirt sizes ordered, how many signups, how many event category is filled… etc etc.

So would like to know if this works for me?

I think not.

I have 2 fields: Employee ID and Employee Name How do I filter the result of Employee Name based on Employee ID field selection Here is my statement: SELECT Employee_Name FROM employees WHERE Employee_ID = !??? What do I put after the equal sign?

The ID of the Employee.

Your support is appalling

There is a 20 page’s PDF documentation at the unzipped Plugin Directory, a link to the documentation at the demo site and a link here at codecanyon. Everything is described.

Can i connect to an other DB than Wordpress? External Database or an other Database on the same Server?

This will take some time.

What happened to this? there is no solution on the whole market. Only your Plugin which fits all requirements expect external databases.

Ich habe es einmal auf der Liste nach oben gesetzt. Hier kann aber nur ein komplett neues Plugin entwickelt werden, da die WPDB Routinen keinen Zugriff auf fremde Datenbanken beinhalten. Es würde dann (wahrscheinlich) ein Plugin das PDO als Datenbank-Lib verwendet.

Is there any way to conditionally create a record? I don’t see the standard Gravity Forms conditional logic on the feed.

not really

Understand. Thanks for letting me know.

No Problem

what would be the way to auto populate with a mysql query that is based on the value selected by the previous field? suppose first field, user seleced a certain row ID, and Id like the 2nd field to present the matching fields of his wpdb row.

This isn’t possible with this plugin.

I would like to use the plugin to add and update data in the database. I would like to be able to pass the primary key to a new Gravity Forms submission and have it update the data. If I do it now, I get an error of a duplicate key because it’s trying to do an INSERT with the Primary Key I provided. I changed $wpdb->insert to $wpdb->replace and it did what I wanted. Would you consider making that change to your code or finding another way to allow data to be updated during a new submission if the Primary Key is provided?

Thanks, Carl

Yep, that does work. Although the one downside of REPLACE is any fields you don’t pass will be reset to NULL (because REPLACE is like DELETE & INSERT). I ended up making some different changes that have been working well.

1) I changed the process_feed_updated function to return the number of rows impacted by the update (by returning the result of $wpdb->update).

2) I added the following code to the top of the process_feed function.

    if(self::process_feed_update( $feed, $entry, $form ) > 0)
      {
        return; 
      }

Basically what this does is in the process_feed function it first tries to update the record. If the update returns 1+ records, then it stops. If it doesn’t update any records (because no records matched the criteria), then it does the INSERT like normal. This way it won’t clear out any fields that are not supplied in the update.

I’m not sure this is the best way to do it, but it’s working well for me. I just don’t like changing the code, because I’ll have to re-implement it each time I update.

Thanks, Carl

I’ll try to implement this as a real update function.

That would be great. This works, but there are a few quirks—mainly, if you don’t make any changes, the function returns 0 rows updated, so the INSERT runs anyway. But since it’s trying to INSERT using the existing ID, it fails (which is good), but it generates unnecessary errors and isn’t the cleanest solution.

Does this plugin connect to an external database on another server and create new entries into a specific table in the external database from the gravity form?

no. only the ‘internal’ Wordpress Datbase

HI there, just a pre-sales question if we may – can we with this plugin slect data from a remote database and populate a Gravity Forms field with that?

Kind regards Francois Wessels

Only the ‘internal’ Wordpress Database

hi .. everything run well except updating GF backend to datatable. i read all the documentation but still unclear

seem some comments got the same problem

For update you need to define a primary key

Hello, the decimals are not syncing properly. please advise.

Are you sure you use the right field type at your database ? What type of field do you use at GF ?

Hello. I just purchased your plugin and so far so good. Just one quick question. Is there a way to change the format of the query we need to use to create a list of choices for our dropdowns? Currently, your documentation says to use

SELECT ‘myValue’, ‘myLabel’ FROM ‘myTable’.

This shows the value first and then the label. I would like to show the myLabel column first but have it submit the myValue column.

For example, I want to show a list of names first but I want it to submit the emailaddress for the selected names. I already have a table with name and email address. So, I want it to show "Firstname Lastname | emailaddress" instead of "emailaddress | Firstname Lastname". For example,

Select emailaddress, name FROM myTable.

I think it would be more user-friendly to show the Label first instead of the Value first. At least that’s how GF does it if you manually input your choices. Hopefully there is a way or I will have to figure out a workaround to make it easier for the user.

Thanks,

Kelvin

The Plugin uses the function to add choices as described from the GF Helpdesk : https://docs.gravityforms.com/gform_predefined_choices/

At your dropdown you need to select ‘use values’.

I added a new release with y changed choices handling. The select is still the same. If you need to display the value at your label, you Need to use the CONCAT function to create a new string.

i have 2 databases on 1 host. 1 for wp and another for a php system i have. is it possible for this to connect to that db and populate ? or does it only connect to the database wordpress is on ?

Sorry. Net yet. There will be a new plugin with PDO driver do access other databases.

I have two forms. One is a Production Dates form. It has a Production Start Date field and a few other fields about the customer and what they have ordered. I initially make Production Start dates using the form, but only select the Production Date. I have about 200 entries into that form.

The other form is an Order Form. It is a long form that captures customer contact info and other product related fields. It also has a Production Date field that allows the sales rep to select one of the Production Dates that are pre-entered in the Production Dates form.

Basically what I want to do is when a sales rep selects one of the Production Dates, when they Save the entry, I need some of the field values from the Order Form saved to Production Date form when the Production Date is the same. Customer Name, Date Sold, Total, Deposit Total and Sales Rep that created the entry.

Maybe this plugin could do this but not sure? It would have to use some logic like if the dates are equal, then save the info into the other form. Can you do this with this plugin?

Also will this work when you edit an entry using Gravity View from the front end rather than in WP Admin?

The plugin can only store the data of the current form.

Hi, i have a question before buy the plugin. I have a register for a promotion in 4 dates, but i need validate 22 register per date and 6 branches. can i do this?

Thanks

The plugin saves the data of the form to a WPBD Database. Nothing else.

Update Functions not working please help me

send me an Export of your form, an exportr of your mysql table and y screenshot of the feed. Be sure the Primary key must also a field at the field select

sure

i didn’t receive your mail

Aside from displaying tables of data, is your plugin able to display data in the website via shortcodes?

for example.. I want to display just one field, do u have shortcodes for this?

by
by
by
by
by
by

Tell us what you think!

We'd like to ask you a few questions to help improve CodeCanyon.

Sure, take me to the survey