How to ignore fields if empty?

I found one solutions and it works, just in case someone could have the same question, I know that the response could be with an: if(input==””){ } But the problem was that I’m inserting every model in an object, so if the fields are empty, it insert in the object empty values, so I just … Read more

Conditional formatting on data fetched from MYSQL

First a few notes: Shortcodes do accept arguments, so you could write [marks subject=”Biology”] (@see https://codex.wordpress.org/Shortcode_API) You should never ever pass raw data directly into a SQL statement, WordPress uses PDO, this means you can prepare statements. (@see https://developer.wordpress.org/reference/classes/wpdb/prepare/) Using the get_results will return an Array, object or null (@see https://developer.wordpress.org/reference/classes/wpdb/get_results/). There are many approaches … Read more