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

I Want a More Concice Form of Data than an Array

Instead of going for a complex nested array, I decided that it might be best to keep it to simple two level set of arrays. $x = array( 101 => [ (int $parent_id), (bool $completed) ], 102 => [ (int $parent_id), (bool $completed) ], 103 => [ (int $parent_id), (bool $completed) ], 104 => [ … Read more