Can’t get wp_insert_post to work

That is because you’re trying to define a property that is already defined, query a table with a wrong name, loop through an integer while you can use get_results instead of query method of $wpdb … I edited the code, hope it will help with your post duplication process: defined( ‘WP_USE_THEMES’ ) || define( ‘WP_USE_THEMES’, … Read more

Deprecated: mysql_connect():

The MySQL extension: Is not under active development Is officially [deprecated][1] as of PHP 5.5 (released June 2013). Has been removed entirely as of PHP 7.0 (released December 2015) Lacks an OO interface Doesn’t support: Non-blocking, asynchronous queries [Prepared statements][2] or parameterized queries Stored procedures Multiple Statements Transactions The “new” password authentication method (on by … Read more

Slow WP_Query for custom post type

That’s a known problem with WordPress and searches involving postmeta. What I’d try to do is to create a new taxonomy for “things” you’re usually searching the most: offer_order_status seems the better candidate, as it can be active or not. I’d create a taxonomy with two elements. That would reduce the time of your search … Read more

Log file reports SQL Error processing child comments

It looks like this is a bug related to caching in WordPress v4.6.1 which you can follow on Trac ticket #37696. A proper fix is scheduled for WordPress v4.6.2, but in the meantime, you could try the following workaround reported by Rarst, who created the issue on Trac: Issue goes away if I disable Object … Read more

Database Tables Lost Indexes? How to Recover?

In general, you can fix the databases with some work in myPHPAdmin. See this article (among others found via the googles) https://www.a2hosting.com/kb/cpanel/cpanel-database-features/optimizing-and-repairing-mysql-databases-with-phpmyadmin There is also this post https://www.maketecheasier.com/fix-corrupted-wordpress-database-2/ that says you can let WP repair the databases by addjine one line in your wp-config.php file: define (WP_ALLOW_REPAIR, “true”); …placing it at the location as specified … Read more

PHP script can’t connect to Database on port 3307

Try this one. This is connection object created to use in wordpress $mydb = new wpdb( ‘username’, ‘password’, ‘my_database’, ‘localhost’ ); and if it is way that you want to go check in codex $wpdb function ‘select’ to select database when do queries. Hope it help.

Can’t find my wordpress DB in phpmyadmin

I don’t see any reason to login as root if you only need the one database… Have you tried logging in to phpMyAdmin as the user with the same credentials as your WordPress installation? user: bn_wordpress pass: 0cca6aaab5 port: 3306 We could avoid phpMyAdmin all together… From the command line you can dump the database … Read more