How to Run PHP Code in WordPress with MySQLi and PDO 2016
Back in 2011, I was tasked by a client to access the WordPress users table using PHP and MySQL and display that data on a WordPress page. Having solved that issue I created a video showing others how to do the same. Surprisingly, so many of you viewed the video and asked quite a lot of questions. Recently, I was asked if I could do an updated version since some of you are now using PHP 7.
Shoutout to Sylvain Joly for asking the question!
So here it is, an updated (2016) version of how to run PHP code in a WordPress page or post. I'm using PHP7, and demonstrating connections using PDO and MySQLi to connect to a MySQL database.
Get the code here http://bit.ly/2fThk7v
Connect with me on social media:
And you can find more great articles and tutorials on Facebook and other social media networks on my blog at
Thanks for watching!