Title: Problem with $wpdb
Last modified: August 22, 2016

---

# Problem with $wpdb

 *  [kuyss42](https://wordpress.org/support/users/kuyss42/)
 * (@kuyss42)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/problem-with-wpdb-1/)
 * Hi,
 * Can i use the SQL Queries in [insert_php]?
 *     ```
       global $wpdb;
   
       $resultats = $wpdb->get_results( 'SELECT nom FROM $wpdb->boutique_france' ) ;
   
       var_dump($resultats);
       ```
   
 * This query works perfectly on phpMyAdmin.
 * But this code displays me a blank page…
 * Thanks a lot!
 * R.
 * [https://wordpress.org/plugins/insert-php/](https://wordpress.org/plugins/insert-php/)

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Thread Starter [kuyss42](https://wordpress.org/support/users/kuyss42/)
 * (@kuyss42)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/problem-with-wpdb-1/#post-5888044)
 * Mistake
 *     ```
       global $wpdb;
   
       $resultats = $wpdb->get_results( "SELECT nom FROM $wpdb->boutique_france" ) ;
   
       var_dump($resultats);
       ```
   
 * With ” of course. But it’s always doesn’t works.
 *  [WillBontrager](https://wordpress.org/support/users/willbontrager/)
 * (@willbontrager)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/problem-with-wpdb-1/#post-5888148)
 * Hi kuyss42,
 * The code must be complete in and of itself. As it is now, $wpdb has no meaning.
   For $wpdb to have meaning, it must be assigned a value somewhere within the [
   insert_php]…[/insert_php] section.
 * See [http://www.willmaster.com/software/WPplugins/insert-php-wordpress-plugin-instructions.php#inandofitself](http://www.willmaster.com/software/WPplugins/insert-php-wordpress-plugin-instructions.php#inandofitself)
   for more information. You’ll also be interested in other sections of the instructions
   page.
 * Will

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Problem with $wpdb’ is closed to new replies.

 * ![](https://ps.w.org/insert-php/assets/icon-256x256.gif?rev=3523853)
 * [Woody Code Snippets – Insert PHP, CSS, JS, and Header/Footer Scripts](https://wordpress.org/plugins/insert-php/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/insert-php/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/insert-php/)
 * [Active Topics](https://wordpress.org/support/plugin/insert-php/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/insert-php/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/insert-php/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [WillBontrager](https://wordpress.org/support/users/willbontrager/)
 * Last activity: [11 years, 3 months ago](https://wordpress.org/support/topic/problem-with-wpdb-1/#post-5888148)
 * Status: not resolved