Title: WP database SQL syntax error:  Apostrophe in list name
Last modified: August 21, 2016

---

# WP database SQL syntax error: Apostrophe in list name

 *  [Aeroclub de Creil](https://wordpress.org/support/users/aeroclub-de-creil/)
 * (@aeroclub-de-creil)
 * [12 years, 3 months ago](https://wordpress.org/support/topic/wp-database-sql-syntax-error-apostrophe-in-list-name/)
 * Hello,
    I put an apostrophe in a list name, which seems to cause an error you
   can see on this page : [http://aeroclub-creil.org/?page_id=2514](http://aeroclub-creil.org/?page_id=2514)
   I kept the list with the incorrect name only to keep this page viewed. The code
   used is the minimum, without any true or false : `[members-list list="Conseil
   d'administration"]`
 * I cheated a little by not using the required apostrophe in the new list…
 * [http://wordpress.org/plugins/members-list/](http://wordpress.org/plugins/members-list/)

Viewing 1 replies (of 1 total)

 *  Thread Starter [Aeroclub de Creil](https://wordpress.org/support/users/aeroclub-de-creil/)
 * (@aeroclub-de-creil)
 * [12 years, 3 months ago](https://wordpress.org/support/topic/wp-database-sql-syntax-error-apostrophe-in-list-name/#post-4543305)
 * It seems to work better with this modification :
    - class/members.php
    - line 236
    - function where()
 *     ```
       //list
         if(!empty($this->list)) {
           //$this->q .= " and d.meta_key='_tern_wp_member_list' and d.meta_value='$this->list' ";
           $this->q .= " and d.meta_key='_tern_wp_member_list' and d.meta_value = '" . addslashes( $this->list ) . "' ";
         }
       ```
   

Viewing 1 replies (of 1 total)

The topic ‘WP database SQL syntax error: Apostrophe in list name’ is closed to new
replies.

 * ![](https://s.w.org/plugins/geopattern-icon/members-list_a1a1a1.svg)
 * [Members List Plugin](https://wordpress.org/plugins/members-list/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/members-list/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/members-list/)
 * [Active Topics](https://wordpress.org/support/plugin/members-list/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/members-list/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/members-list/reviews/)

## Tags

 * [sql-error](https://wordpress.org/support/topic-tag/sql-error/)

 * 1 reply
 * 1 participant
 * Last reply from: [Aeroclub de Creil](https://wordpress.org/support/users/aeroclub-de-creil/)
 * Last activity: [12 years, 3 months ago](https://wordpress.org/support/topic/wp-database-sql-syntax-error-apostrophe-in-list-name/#post-4543305)
 * Status: not resolved