The WordPress open-source content management system (CMS) will show warnings in its backend admin panel if the site runs on top of an outdated PHP version. The short-term plan is to migrate as many active users to more recent versions of PHP as possible so that the WordPress team can drop support for older PHP […]
Category: PHP
mysql_connect() in PHP 7
After upgrading to PHP 7.x from PHP 5.x, you start getting error of “Call to undefined”. This is because mysql_* functions are completely removed from PHP 7, it was get deprecated in PHP 5.5 but now it is completely removed. The older mysql function are removed due to following reasons: Not work on Object Oriented […]
How to show a button with condition in PHP
Scenario: Let’s say we have “Get Details” and “Update Details” buttons. And we want to make visible Update button after we fire the “Get Details” button. This is Get Details button:
Navigate to a Div using a button in HTML
The Div: <div id=”DivToNavigate”> The content goes here… </div>
Repeater Function in PHP
You need to do a while loop to pull each rowset. mysql_fetch_array() will only pull one row at a time. Consider this solution: <?php $dbhost = ‘xxxx’; $dbuser = ‘xxxx’; $dbpass = ‘xxxx’; $dbname = ‘xxxx’; $conn = mysql_connect($dbhost, $dbuser, $dbpass) or die (‘Error connecting to mysql’); mysql_select_db($dbname, $conn); $result = mysql_query(“SELECT * FROM mytable”, $conn); <table> […]
How do you connect to multiple MySQL databases on a single webpage?
You can make multiple calls to mysql_connect(), but if the parameters are the same you need to pass true for the ‘$new_link‘ (fourth) parameter, otherwise the same connection is reused.
How to connect MySQL Database with PHP
You can try code below:
Disable REST API Plugin
Disable the REST API with a Plugin: If you want to try a completely different solution you can try out https://wordpress.org/plugins/disable-json-api/ which takes care of removing the REST API functionlity for you. Disable the REST API without a Plugin: Maybe you don’t use any security plugins. While I recommend that you reconsider and install either WordFence or […]