SELECT rows between two datetimes when the range is dynamic

I’m trying to select rows that fall into a certain date range from my database table. The range is determined dynamically by the user. In my database I have a column called “dateAndTime”. It has dates stored into it in this format: 2021-06-01 19:37:00 I’m trying to select the rows with this: function getEventsByDateRange(){ $eventType … Read more

Increment integer field in database when WHERE needs to be dynamic

I have a database column called “upvotes”. I have another column called “userid”. I would like to increment the value in the “updates” column where the userid matches the dynamic variable I’m providing. Here’s my attempt: $results = $wpdb->query("UPDATE points SET upvotes = upvotes + 1 WHERE userid= %d", $theDynamicUserID); That is giving the following … Read more

dynamic css file for admin / backend and get_option results in Uncaught Error: Call to undefined function get_option()

I try to style the admin area with a dynamic css. I need to configure some elements regarding the frontend user defines. He can choose a color and this color should reflected in some elements in the admin area (e.g. buttons in admin area).
My approach: Setting up a evacolor.css, but let apache interpret this as a php file. This works so fare: