Can local WordPress installs share /wp-content/ folder and database?

For wp-content folder you need to add WP_CONTENT_DIR with path to this folder to each wp-config.php file of each your sites. All of these WP_CONTENT_DIR constants should have the same path to one folder. Read more about it here: http://codex.wordpress.org/Editing_wp-config.php#Moving_wp-content To share the same database, you just need to setup the same database settings in … Read more

Cant connect to database with php 7.3

Old versions of mysqlnd worked with legacy database passwords. I had to update the database to use more secure password format before the mysqlnd plugin would connect from WordPress 5.0.3 to php 7.3 PHP Warning: mysqli::__construct(): (HY000/2000): mysqlnd cannot connect to MySQL 4.1+ using the old insecure authentication. Please use an administration tool to reset … Read more

Can’t successfully check if post with title exist in database

You have typing mistake. You are using the double quotation mark instead of single quotation mark at the end of the code post_status = “publish” Please use post_status=”publish” instead of post_status=”publish” and then use double quotation mark at the end of query. And also make sure that dynamic values are correctly entered in the query … Read more

Using $wpdb | checking entered email against existing emails in db

You shouldn’t be using mysql_num_rows() or mysql_error() when dealing with $wpdb. Even if you weren’t, mysql_error() is for database errors, and an empty result set is not a database error. If you want to know if results were returned, simply check the count() of the results: $duplicateEmail = $wpdb->get_results($emailTest, OBJECT); if ( count( $duplicateEmail ) … Read more