How to execute mulitple statement SQL queries using $wpdb->query?

I call $wpdb->query() on a query like INSERT INTO wp_ctt_timetables (name, homework, tod, class, dow, lesson) VALUES ( »,  »,  », 3, 0, 0); INSERT INTO wp_ctt_timetables (name, homework, tod, class, dow, lesson) VALUES ( »,  »,  », 3, 0, 1); INSERT INTO wp_ctt_timetables (name, homework, tod, class, dow, lesson) VALUES ( »,  »,  », 3, 0, 2); INSERT INTO wp_ctt_timetables (name, homework, tod, class, dow, lesson) VALUES ( »,  »,  », 3, 0, 3); — and so on But it doesn’t work and says this to the error log: You have an error…

$wpdb->query doesn’t accept query with multiple statements separated with a semicolon, but phpMyAdmin accepts this query

I call $wpdb->query() on a query like INSERT INTO wp_ctt_timetables (name, homework, tod, class, dow, lesson) VALUES ( »,  »,  », 3, 0, 0); INSERT INTO wp_ctt_timetables (name, homework, tod, class, dow, lesson) VALUES ( »,  »,  », 3, 0, 1); INSERT INTO wp_ctt_timetables (name, homework, tod, class, dow, lesson) VALUES ( »,  »,  », 3, 0, 2); INSERT INTO wp_ctt_timetables (name, homework, tod, class, dow, lesson) VALUES ( »,  »,  », 3, 0, 3); — and so on But it doesn’t work and says this to the error log: You have an error…

Web Design Weekly #321

Headlines Yes, design systems will replace design jobs Design systems have plenty of tactical challenges — how to start, maintain and adapt them, and so on. But arguably the biggest question is cultural: What will happen to software designers’ jobs as their work is increasingly automated? (designsystems.com) Is GraphQL The Future? If you are not sold on GraphQL then this post might tip you over the edge. Alan Johnson does a great job in explaining the awesomeness that GraphQL has to offer. (artsy.github.io) How to Take Criticism (chappellellison.com) Articles A…

How to get next post and previous post URL in loop, single.php My WordPress 4.9.6

I want to show next previous button in single.php please suggest me the possible way, I’m stuck at these point in my site development Next Previous > <?php posts_nav_link(); ?> <?php > posts_nav_link(‘separator’,’prelabel’,’nextlabel’); ?> <?php echo > get_next_posts_link(); ?> > > Default Usage > > <?php echo get_next_posts_link(); ?> just want to add links in these buttons please suggest me the best way and links need to add in the loop. I have tried basic functions but can’t get output as i want Source: https://wordpress.stackexchange.com/feeds

load wordpress events into full calendar jquery

I am trying to load my custom post type events into jquery plugin full calendar but nothing is working. I have made a php file with this code include « wp-load.php »; global $wpdb; header(‘Content-Type:application/json’); $events = array(); $result = new WP_Query(‘post_type=events&posts_per_page=-1’); foreach($result->posts as $post) { $events[] = array( ‘title’ => $post->post_title, ‘start’ => ‘2018-03-12T20:00:00’, ); } echo json_encode($events); exit; But its not loading anything Source: https://wordpress.stackexchange.com/feeds

Pull MySQL data from multiple tables and merge into 1 PHP array

Appreciate help in advance. I am dealing with a bit of a pickle with a formula. I am trying to create a page template that will display a list of users, specific metadata from usermeta table + additionally I want to pull data from table created by me. Here is a screenshot of the table structure: https://www.screencast.com/t/X07XDr3Gy. I got it partially working to get user name, surname and company: $sql =  » SELECT {$wpdb->users}.ID, firstname.meta_value as first_name, lastname.meta_value as last_name, webaria_company.meta_value as webaria_company, FROM {$wpdb->users} INNER JOIN (SELECT user_id, meta_value…

Search Terms – Querying on either description__like OR name__like in the same Term Query?

In my theme’s search.php I have a section set up to show terms that fit the search. I want the term to show up IF the $keyword appears in the term’s title or its description. I have it set up to do just that but if feels clunky to me to have to do two separate queries then prune the results to make sure each term is only displayed once. $search_matters_args = array( ‘taxonomy’ => array(‘book’, ‘magazine’), // taxonomies to search ‘orderby’ => ‘id’, ‘order’ => ‘ASC’, ‘hide_empty’ => false,…

Web Design Weekly #320

Headlines My Struggle To Learn React Learning can be hard. Admitting that can be harder. In this post Brad Frost shares his recent struggles with React which is quite inspiring. We really don’t see enough of these types of posts. (bradfrost.com) The Front-End Tooling Survey 2018 – Results (ashleynolan.co.uk) The key to communication between designers and engineers. ​FullStory captures every customer session on your site and replays it like a DVR, complete with the JavaScript console and all underlying code. Now you not only have an artifact of every bug,…

Js errors in wp-admin

I have a lot of js errors in wp-admin and, for example, I can’t see visual composer in post or pages, I can’t add a box to a widget, etc. I got that errors in all wp-admin pages. I updated wp and all plugins but nothing. How can I solve that? Thanks Ale Source: https://wordpress.stackexchange.com/feeds

Get current user id

I need to print the user’s id into this array but it doesn’t seem to be working. I have tried all sorts of things from $user->ID to $user_id to no avail. I am trying to get the value from my functions.php Any help would be greatly appreciated! Here what’s in my php function: $user_page = get_queried_object(); $user_id = $user_page->data->ID; $args = array( ‘post_type’ => ‘listings’, ‘post_status’ => ‘publish’, ‘meta_query’ => array( array( ‘key’ => ‘stm_car_user’, ‘value’ => $user_id ) ) ); $query = new WP_Query($args); I’m sorry if my question…