Title: Illegal string offset &#8216;name&#8217;
Last modified: January 23, 2017

---

# Illegal string offset ‘name’

 *  Resolved [patrickhait](https://wordpress.org/support/users/patrickhait/)
 * (@patrickhait)
 * [9 years, 4 months ago](https://wordpress.org/support/topic/illegal-string-offset-name/)
 * Hello, I have WP 4.7.1 and am trying to use PHP 7.0, but am having some difficulty.
   My PHP error logs show: `Illegal string offset 'name' in /home/.../public_html/
   wp-content/plugins/members-list/class/members.php on line 432` The plugin does
   not work.
    When I drop down to PHP 5.6, the plugin works, but in the error log,
   I get `PHP Deprecated: mysql_escape_string(): This function is deprecated; use
   mysql_real_escape_string() instead. in /home/.../public_html/wp-content/plugins/
   members-list/class/members.php on line 450` It seems like a mysqli type thing,
   but I’m not sure. Is there any update that can be made to make it compatible 
   with PHP7 and WP 471?

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

 *  Plugin Author [ternstyle](https://wordpress.org/support/users/mpraetzel/)
 * (@mpraetzel)
 * [9 years, 3 months ago](https://wordpress.org/support/topic/illegal-string-offset-name/#post-8732178)
 * I can fix the 5.6 error for you!
 * Change the sanitize function on line 642 of /class/members.php to the following:
 *     ```
       function sanitize($s) {
       		// to be used in future updates
       		$p = new PDO('mysql:dbname='.DB_NAME.';host='.DB_HOST,DB_USER,DB_PASSWORD);
       		return substr($p->quote($s),1,strlen($p->quote($s))-2);
       	}
       ```
   
 * As far as the first error goes, what does your shortcode look like?
 *  Thread Starter [patrickhait](https://wordpress.org/support/users/patrickhait/)
 * (@patrickhait)
 * [9 years, 3 months ago](https://wordpress.org/support/topic/illegal-string-offset-name/#post-8732181)
 * When I view the page using PHP7, I see the entire page Except for the list of
   members… I see the alphabet where I can select the letter for the listing, but
   I cannot see any members.
 * Note: When I switch back to PHP5.6, all works well. I want to go over to PHP7
   though!
 * Are there any plans to fix that function for ‘Illegal String Offset’?
 *  Thread Starter [patrickhait](https://wordpress.org/support/users/patrickhait/)
 * (@patrickhait)
 * [9 years, 3 months ago](https://wordpress.org/support/topic/illegal-string-offset-name/#post-8732205)
 * Thanks for getting rid of the errors in PHP 5.6!
    I replaced the sanitize function
   what was on line 448-450 with the code that you suggested.
 * However, the same behavior displayed itself when I tried out PHP 7 again. No 
   list, and several instances of “Illegal string offset ‘name’ — 432″ in the php
   error log.
 * Edit: Strange — It thinks it’s displaying #1-5 .. and then when I go to the next
   page #6-11, and it even leaves blank space for them (Under PHP7), but nothing
   is displayed.
 * My Shortcode is: [members-list list=”” search=true alpha=true pagination=true
   pagination2=true sort=true radius=false]
    -  This reply was modified 9 years, 3 months ago by [patrickhait](https://wordpress.org/support/users/patrickhait/).
      Reason: more details
    -  This reply was modified 9 years, 3 months ago by [patrickhait](https://wordpress.org/support/users/patrickhait/).
    -  This reply was modified 9 years, 3 months ago by [patrickhait](https://wordpress.org/support/users/patrickhait/).
      Reason: updated shortcode
    -  This reply was modified 9 years, 3 months ago by [patrickhait](https://wordpress.org/support/users/patrickhait/).
    -  This reply was modified 9 years, 3 months ago by [patrickhait](https://wordpress.org/support/users/patrickhait/).
 *  Thread Starter [patrickhait](https://wordpress.org/support/users/patrickhait/)
 * (@patrickhait)
 * [9 years, 3 months ago](https://wordpress.org/support/topic/illegal-string-offset-name/#post-8733815)
 * So Sorry! You can mark this ‘probably’ solved .. I was stuck on an old version
   3.6.3. I tested the plugin on another site and saw that it worked on PHP7. It
   was a change that I made a long time ago and forgot that I didn’t allow the upgrade
   to happen. Thank you for your assistance.
 *  Plugin Author [ternstyle](https://wordpress.org/support/users/mpraetzel/)
 * (@mpraetzel)
 * [9 years, 3 months ago](https://wordpress.org/support/topic/illegal-string-offset-name/#post-8734735)
 * Excellent! Glad everything worked out.

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

The topic ‘Illegal string offset ‘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/)

 * 5 replies
 * 2 participants
 * Last reply from: [ternstyle](https://wordpress.org/support/users/mpraetzel/)
 * Last activity: [9 years, 3 months ago](https://wordpress.org/support/topic/illegal-string-offset-name/#post-8734735)
 * Status: resolved