Index

  1. Home
  2. Docs
  3. Index

Index

Articles

Was this article helpful to you? Yes 3 No

7 Replies to “Index”

  1. Hi,
    it is possible to publish a query instead of the entire table?
    I want to show in the linked page anly the events in program, as shown by this query:
    SELECT *
    FROM `Eventi`
    WHERE `Dal` >= NOW( )

    Can you help me?

    Regards

  2. Hi Silvio,

    Adding a where clause to a publication is not yet supported but it is on my to do list.

    But…you can achieve the same result with a view. You just need to create a view for your query, give access rights to that view in the Front-end Settings and use the view in the Data Publisher in the same way as you would use table Eventi.

    Hope this helps…

    Best regards,
    Peter

  3. An excellent instructional experience regarding very helpful features/additions to the already very fine plug-in. Strong work! Thank you very much.

  4. Hello,
    I am probably in the wrong place. I am totally ignorant about how to manage a database and I have a problem:
    I do manage an LMS with Learndash (https://hendersondrivingschool.com ) to teach Driver’s Education for teens. I do have over 1200 students. many are not active anymore (they are usually active from 3 days to one year-
    They do have to follow 10 lessons for30 hrs course and must pass a 50 question exam to be allowed to pass their drivers’ License at the DMV.
    I am doing this for the last 5 years. the DMV wants us to keep data for 3 years, which represents a lot of data and pages.
    I like to delete everything that is outdated over 3 years and I am very afraid to touch anything. (still learning at 76)
    one of the tables is HUGE. named: learndash_user_activity_meta | Base table | rows: 311194 |increments: 1840614 | MyISAM | 20.99 MB
    Could I use this plugin to delete any data older than 3 years old? and how would I proceed?
    Could it be set up to delete that automatically past a certain date?

    Any guidance would be appreciated!
    Thank you
    Pierjean

    1. Hi Pierjean,

      The plugin is not specifically meant to do such a job, but you can. However, be careful! Make a backup before you touch anything…

      STEP 0
      Do you have a backup facility with your provider? If so, use it to create a back before you start.

      STEP 1
      Use WP Data Acces to make a backup of table learndash_user_activity_meta:
      – Start the Data Explorer
      – Find your table
      – Click on Manage link just below that table
      – Click EXPORT (select SQL and disable checkbox “Include table settings (SQL only) “)

      In your case this export might take a few minutes. There is a lot of data to be exported.

      STEP 2
      I would advice not to perform any delete actions directly on your table. Instead I would suggest to create a copy of your table and use that copy for testing:
      – Start the Data Explorer
      – Find your table
      – Click on Manage link just below that table
      – Click COPY (add a name like: learndash_user_activity_meta_TESTING and check checkbox “Copy data”)

      This might take a few minutes again.

      STEP 3
      Create a SQL file, for example: delete_old_students.sql
      You can do this in your the Explorer. Open the SQL file you just created and add:
      delete from learndash_user_activity_meta_TESTING where your-date-column < '2018-01-01'; Make sure the delete statement ends with a semi colon and a new line. So you'll see an empty line below the delete statement. Don't forget to replace your-date-column with column name which is used to identify that the row is over three years old. MOST IMPORTANT: make sure you delete from learndash_user_activity_meta_TESTING!!! Not from learndash_user_activity_meta. You'll do that when you are sure everything is fine. STEP 4 - Start the Data Explorer - Click on button "Import data/Execute script(s)" - Select the SQL you've just created - Click on button "Import file/Execute script(s)" STEP 5 Check table learndash_user_activity_meta_TESTING. Is eveything fine? Are you 100% sure you're not missing any data? If you are missing data, the delete statement is not correct. If you want to try again, drop table learndash_user_activity_meta_TESTING and start again at STEP 2, until you have what you want. It you are a 100% sure everything is fine, you can change the table name in your SQL file and run it against table learndash_user_activity_meta. You'll still have the backups created in STEPS 0 and 1 if anything goes wrong. CLEANUP When you are ready, drop table learndash_user_activity_meta_TESTING: - Start the Data Explorer - Find table learndash_user_activity_meta_TESTING - Click on Manage link just below that table - Click DROP Make a copy of this procedure for next year. You just need to change the date, but you should test anyway. Better safe than sorry! 🙂 Hope this helps! Good luck, Peter

  5. Hi Peter,
    Love your plugin. Great job.
    However, I’m having some difficulty reconciling the design in Data Designer with the actual table. Initially created some tables with the Data Designer. Could not figure out how to add foreign key contraints, so did that through phpMyAdmin. So far, so good. But now FK constraints don’t show up in Data Explorer, nor can I update/reconcile the design in Data Designer.
    I created corresponding lookups in Project Templates, but when I try to insert a record, it fails with error “Opslaan wijzigingen niet gelukt [Cannot add or update a child row: a foreign key constraint fails (`uXXXXXXXXXXXX_sopnl`.`service`, CONSTRAINT `service_category` FOREIGN KEY (`service_category_id`) REFERENCES `category` (`category_id`))]”.
    What am I missing here? Please advise.
    Thanks!
    Best regards, Alex

    1. Hi Alex,

      Thank you for your compliment! 🙂

      The plugin does not support foreign key constraints. WordPress is used on many different servers with many different databases, not all supporting foreign key constraints. That is why WP Data Access has its own implementation to handle relationships. If you create your own foreign key constraints the database will use them anyway. So from the message you get I think the relationship defined in WP Data Access is not completely in sync with your foreign key

      Can you give me some more details? I’m interested in your foreign key constraint and your relationship definition in the plugin. You can use the contactform to send this information in private.

      Thanks,
      Peter

Leave a Reply to Silvio Cancel reply

Your email address will not be published. Required fields are marked *

four × 4 =