Sql query returns empty. But not

If you can answer ‘yes’ to the questions in Emetrop’s comment, then try: $sql = $wpdb->get_results(‘SELECT * from table1 WHERE id = $bransId’);

Insert multiple checkbox values

I solve it. public function insertionRow($id){ global $wpdb; $wpdb->query(“INSERT INTO wp_choix_attributs_liste (att_id) VALUES (“.$id.”);”); } In my html with the checkbox. if(isset($_POST[‘sub’])) { foreach ($_POST[‘choixP’] as $id) { self::insertionRow($id); } }

Analog category_and (WP) in sql query

Thanks Milo for the answer! This block of code selects posts that have two categories at the same time. ( ( SELECT COUNT(1) FROM wp_term_relationships WHERE term_taxonomy_id IN (35,33) AND object_id = wp_posts.ID ) = 2 ) Where 35,33 are categories IDs and 2 – number of categories.

blank page after update my theme

A blank page (‘white screen of death’) is usually caused by a fatal error in the PHP code. Since you said that you updated your theme (although it is not clear whether you personally updated the code, or if the theme was updated by the theme developer), then the problem is most likely in the … Read more

Is it possible to utilize custom SQL for a single-post.php?

If you just want the ID of the requested post within the template, get_queried_object_id() will give you that. If you want to modify the main query SQL before it’s executed, there are a number of filters that let you directly modify the SQL.

query sql-table and change entities

You should gotten return from SQL first. And then print results. Use $wpdb class for SQL queries. If you wanna use native SQL queries something like this might helps you $result = mysql_query(“SELECT * FROM table”); $result_array = mysql_fetch_array($result, MYSQL_ASSOC); But it`s very bad idea. Use $wpdb with preparing.

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)