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

I would like some help wth an SQL query to link posts with categories

You need to JOIN the term tables with the posts table, something like this: SELECT p.post_name, p.post_content, t.name FROM wp_posts p JOIN wp_term_relationships tr ON ( tr.object_id = p.ID ) JOIN wp_term_taxonomy tt ON ( tt.term_taxonomy_id = tr.term_taxonomy_id ) JOIN wp_terms t ON ( t.term_id = tt.term_id ) WHERE p.post_type=”post” AND p.post_status=”publish” AND tt.taxonomy = … Read more