• Resolved christieprimier

    (@christieprimier)


    Ok. Me again. I hope this is as simple as the last one 🙂 but I’m looking to copy the database that I already have to a new database…and link it to a new form…that’s not emailed.
    The database I already have houses person’s info for a team along with team name and rank.
    I want to copy that into a new database where I can search by player, show all of the teams that specific player has played on, and if his or her rank.
    Any help is appreciated. 😀

    Christie

    https://wordpress.org/plugins/contact-form-7-to-database-extension/

Viewing 15 replies - 1 through 15 (of 17 total)
  • Plugin Author Michael Simpson

    (@msimpson)

    If you purchase the CFDB Editor extension you can:

    – Go to a CFDB Import administration page
    – Download a Backup CSV File of a form (say called “form1”)
    – Import the same file you just exported, but give it a new form name (say “form2”)
    — (you now have 2 copies of the same submissions under “form1” and “form2”)
    – Define a new form using the new form name (“form2”) and its new submissions will be saved until “form2” not “form1”

    I don’t quite following the “linking” part so I don’t know if this covers your use case.

    Thread Starter christieprimier

    (@christieprimier)

    Mike,
    Sweet that worked 🙂 thank you.
    By linking I meant. I want all of the data from the team database to save to the player database as well. Because that way I know all of the information is up to date. I want to copy it only if the approved is Yes.

    Then I’d like to have the capability to save some of the information in other areas. For example when you register a team it has a team class.
    When it’s copied to the Player database…I want that to be saved to the player class.

    Thanks in advance.I’m going to be playing around with it to see if I can figure it out….worse case scenario they enter the data 2x.

    Plugin Author Michael Simpson

    (@msimpson)

    That is a bit complicated. The plugin is just captures data, it does not manage relationships among them.

    Thread Starter christieprimier

    (@christieprimier)

    Mike,
    Is there a way?
    I will keep looking cause there should be something out there that allows you to code If or case statements. then call either the data from form1 or form2….right? Or am I not making any sense?

    Plugin Author Michael Simpson

    (@msimpson)

    I don’t follow completely, but you can add custom PHP code:

    Inbound: form submission:
    Changing Form Data Before it is Saved
    – you can use this hook to add code you want, including querying the data from other forms. There isn’t a specific API for updating & deleting data.

    Outbound: displaying information – you can query data from two or more forms at a time like they are one form simply by setting form=”form1,form3″. You can create custom transform function and transform classes to manipulate the data coming out of a shortcode. Or you can create your own shortcode.

    Thread Starter christieprimier

    (@christieprimier)

    Mike,
    I hate to be a pain and I’m sorry if I’m causing you frustration.
    I don’t want to change the data before it is saved. I just want to have the luxury of saving it in another spot if approved is yes then tweaking the data and saving it to the player information database.

    Plugin Author Michael Simpson

    (@msimpson)

    Right, my point there is that the hook used in the example for changing data can be used to do something else with the data such as save it elsewhere (you write the code for the hook to do that). I just wanted you to be aware of that option in case it is helpful.

    Thread Starter christieprimier

    (@christieprimier)

    Mike,
    LOL sweet! Alright I get it now. Sorry there are times when I take things a little too literally 🙁

    I will see what i can do and will update you 🙂

    Thread Starter christieprimier

    (@christieprimier)

    Mike,
    I’m still working on this…quick question. If I upload a file and have the client (for now till I figure out automated) click a button to upload the players. That should work cause then I’m just importing data…right? My manager gave me that direction and I was wondering if you had any input.
    Also didn’t know where all the code for the button was placed? I know one is the contact form…not sure where else that code magically appears. 🙂 Thanks again for your time

    Plugin Author Michael Simpson

    (@msimpson)

    From the CFDB Import page (must be a logged in user with permissions to edit CFDB data) you can import a CSV file into an existing form or a new form.

    But this is different from having a regular form with a file upload where you might want to import what is in the file. CFDB doesn’t do that. I don’t know how you mean it.

    Thread Starter christieprimier

    (@christieprimier)

    Mike,
    I figured it out 🙂 I had to create custom PHP code that would read the data in 🙂 ONLY if approved was YES, loop thru the players then assign it back to the table 🙂 IT WORKED!!!! I was SSSOOO Happy but now I’m having trouble finding where the submit_time gets assigned….if you could provide direction that would be great. I’m going to continue to dig 🙂

    Thanks again Mike 🙂
    Christie

    Thread Starter christieprimier

    (@christieprimier)

    Mike,
    I need help….Everything is working on the code side…:) Now when I go to see the players on the contact_form side I get one. 🙁 When I should have around 60. Please if you could shed some light I’d appreciate it

    Plugin Author Michael Simpson

    (@msimpson)

    Each entry must have a different submit_time value. CF7DBPlugin::generateSubmitTime() will generate unique submit times. This is handled for you by the CFDB Editor import.

    Thread Starter christieprimier

    (@christieprimier)

    Mike,
    I hate to be a pain…so if I have it in a php file. to manually insert querys. It would be at the top of the file…right?

    Thread Starter christieprimier

    (@christieprimier)

    Mike,
    Thank you so much for taking the time to chat with me. I have a feeling that I am already putting in the time stamp. Let me pause and back up and let you know what all I have done on this project 🙂
    I have created a php file with functions that brings in the team information based on the unique Identifier (Time) then loops thru all of the player information and using an insert into puts that information into the player form. Then every day at midnight I have a cron job that runs to make sure that if there is any new teams that I have populated the player database only if they are approved then I change the approved to import so that I don’t receive duplicate data.

    Where I am getting stuck is everything assigns/writes to the player_form in the database on the server. It’s beautiful BUT!!! when I go on the website to the Player_Form under CFDB I only get one entry not the 100 and some that I should get 🙁 Any insight, advice would be appreciated…I would even love to talk to you or chat I will not abuse it I just want to make sure that I am using everything the way I’m suppose to 🙂

    Thanks in advance…sorry for the book post.
    Christie

Viewing 15 replies - 1 through 15 (of 17 total)
  • The topic ‘New Database’ is closed to new replies.