Quantcast
Channel: WordPress › Support » Forum: Hacks - Recent Topics
Viewing all articles
Browse latest Browse all 8245

CheckMater on "$wdpv returning nothing when using it via AJAX plugin."

$
0
0

Good day, I have a problem with my plugin because $wdpb returns an error when trying to do any query, my code is as follows:

function search_engine_callback() {
	global $wpdb;
	$keyword = addslashes($_POST['keyword']);
	//Get all related posts from the WP db...
	$wpdb->show_errors();
	$res = $wpdb->get_results("SELECT id, post_title FROM wp_posts  WHERE post_title = '$keyword'", 'ARRAY_A');

And it shows me this error:

Wordpress Database Error: [] and the previous query.

All works fine in the AJAX function but the query doesn't return anything (No matter which query you add) it always return an empty [] as error.

Any suggestion?

Thanks in advance!


Viewing all articles
Browse latest Browse all 8245

Trending Articles