WordPress users table missing indexes

Sounds like the auto increment handling is not setup correctly. Go into phpMyAdmin and make sure that the PRIMARY KEY is set to AUTO_INCREMENT You can also run this SQL command: ALTER TABLE wp_users AUTO_INCREMENT = 1 The 1 above you need to make sure the auto increment value is set to the highest number … Read more

How to show result of sql query in a page?

Solved! I follow this tutorial: https://wordpress.org/gutenberg/handbook/designers-developers/developers/tutorials/block-tutorial/writing-your-first-block-type/ https://wordpress.org/gutenberg/handbook/designers-developers/developers/tutorials/block-tutorial/creating-dynamic-blocks/ And complimented with this: https://gist.github.com/mattheu/7cf235b4f932de891bc21cb5f3ff3de6

Export only a part of the database for migration

If you don’t mind exporting pages and posts separately, you can use the default WordPress export tool to achieve that. On the Export screen you can set the tool to export only posts. Then add a suitable date filter. After that do another export, but this time set the tool to export only pages. You … Read more

Where is the HTML-handler part in the wpdb class?

wpdb->query() is just running the query. It doesn’t do anything special. And strip_invalid_text_from_query() based on the inline documentation is just stripping invalid characters in the query. And, for your information, something like line-breaks doesn’t break the database. The database can accept any string data. You just have to make sure it correctly escaped when the … Read more

Error establishing a database connection in wordpress

I had this issue some days ago with a multisite, loading a live dump to local development. After some debugging I noticed, that the error message wasn’t right. The database was connected, but the path in the database to the sites was wrong. You can check table <your-prefix>_site and <your-prefix>_blogs if columns domain and path … Read more