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.

Get category from slug list

$category_slug_array = array(‘slug_1’, ‘slug_2’, ‘slug_2’); //array of category slugs foreach($category_slug_array as $category_slug){ $my_categories[] = get_term_by( ‘slug’, $category_slug, ‘category’); //getting category object by slug } print_r($my_categories); //printing array of categories

How to process a single attribute in a SQL request twice times?

WordPress 4.8.2 specifically restricts the convenient usage of numbered placeholders like %1$s, %1$d, %1%f in WPDB::prepare. (core.trac.wordpress.org/ticket/41925). To avoid usage of numbered placeholders, SQL query has to be rearranged to just use only one %s. SELECT DISTINCT t.`Date`, y.* FROM `table` t LEFT JOIN `table` y ON (t.`Date` = y.`Date`) WHERE t.`country` = %s ORDER … Read more

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