Query doesn't work in WPDB but works in phpmyadmin
-
Hello,
I am having a problem with database access using the WPDB class.
When I print the query to the output and run it in phpmyadmin, the query gives the expected result. However, WPDB does not provide the results. Also, there is no error message. The error logs show an database error, but without error message.$wpdb->show_errors(); $testQuery = $wpdb->prepare("SELECT * FROM $table_name WHERE service_id = %d AND token = %s" , $service_id, $token); $testResult = $wpdb->get_results($testQuery,ARRAY_A); echo "<pre>testQuery\n$testQuery\n"; echo "testResult: "; print_r($testResult); echo "db error:" . $wpdb->last_error; echo "</pre>";
Can anyone give their thoughts about this issue?
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
- The topic ‘Query doesn't work in WPDB but works in phpmyadmin’ is closed to new replies.