Restrict users viewing post using age on database [closed]

There are probably a few ways to do this. The easiest way I can think of is to install Pods Framework. You can install it through the WordPress repository like you’d normally install a plugin, or through GitHub. Using Pods, you can extend the WordPress user database to add a birthday field. You can also … Read more

Problem with form database connectivity

You’re inserting raw POST data straight into an SQL query – sanitize, sanitize, sanitize! The code below should get you started, but I would advise you add some additional checks (is the email valid? are the strings too long? etc.): <?php $errors = $values = array(); if ( isset( $_POST[‘Submit’] ) ) { $fields = … Read more

How to create a table [closed]

Here you go Javier, this should work. I included comments within the code to try and show you where things needed to change and added a few things you were missing. I’ll explain more below. <?php /* Should really come up with something more unique and related to your plugin */ function yourplugin_dbcreation() { global … Read more

WP_Query with LIKE returns strange query

You can’t use LIKE to compare arrays. LIKE is used to check if a string matches, or partially matches, a value in the database. IN is used to check if a value in the database is in a given set of values. They are not interchangeable. The correct comparison to use in your case depends … Read more

Where are database files of a WordPress website?

But surprisingly, not many threads show where these files exactly are in the server. WordPress doesn’t have files it manages, it instead relies on MySQL/MariaDB for database storage and execution. So you will not find the database stored as a file within a WordPress installation. If you need to handle database data in a file … Read more