Hot answers tagged


you may need to wrap $slug in quotes $course = $wpdb->get_results( "SELECT * FROM wp_posts where post_name = '$slug'" );


So if you're sure you want to delete the actual term as well as the relationship that assigns the term to the post, this will do it (tested and works for me): delete term from wpterm_taxonomy term, wpterm_relationships rel where term.term_taxonomy_id = rel.term_taxonomy_id and rel.object_id IN (1) ; And obviously replace the '1' there with how you're ...


There are several problems with your function. For example, $tablename points to a table that does not exist. And you don't need it anyway. If you are trying to create a new user if that email does not exist then try this: function register_user() { global $wpdb; $name = $_POST['name']; $email = $_POST['email']; $password = $_POST['...


It looks like this is the new part of this query causing the problem, is that right? (SELECT term_taxonomy_id FROM wp_BOMEGAterm_relationships WHERE object_id = p.ID) AS categories If so the error message is clear: a sub-select in this query should only return one row. If it returns more than one row it doesn't know how to mash all those many rows into the ...

Only top voted, non community-wiki answers of a minimum length are eligible