I created a wordpress plugin with a shortcode. I am just wondering why the content in the shortcode does not show after calling $wpdb->get_results();
Below is the code:
$query = "SELECT * FROM table WHERE field='$var' ORDER BY field2 ASC";
//return 'test'; //this one works...
$results = $wpdb->get_results($query);
if($results === false)
return 'error occured'; //wont work or display
if(count($results) > 0)
return 'has results'; //wont work or display also..
else
return 'no results found' //wont work or display also..
The query was okay because I returned it before calling the function then test in mysql, and there are results. Now what is going on here?
Thanks..
$wpdbas a global at any point? – m0r7if3r Mar 6 '12 at 11:24WP_DEBUG_QUERIESset to true in your wp-config.php – kaiser Mar 7 '12 at 9:35