Title: could not use PDO with &#8216; -&gt; &#8216; command
Last modified: November 18, 2017

---

# could not use PDO with ‘ -> ‘ command

 *  [wan1402](https://wordpress.org/support/users/wan1402/)
 * (@wan1402)
 * [8 years, 4 months ago](https://wordpress.org/support/topic/could-not-use-pdo-with-command/)
 * I have codes with PDO, such as myPDO->prepare(), but it return error:
    Fatal 
   error: Uncaught Error: Call to a member function prepare() on null
 * when I run the same codes on independent .php file, it executes normally.
    Kindly
   help. Thanks,

The topic ‘could not use PDO with ‘ -> ‘ command’ is closed to new replies.

 * ![](https://ps.w.org/insert-php-code-snippet/assets/icon-128x128.png?rev=1800967)
 * [Insert PHP Code Snippet](https://wordpress.org/plugins/insert-php-code-snippet/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/insert-php-code-snippet/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/insert-php-code-snippet/)
 * [Active Topics](https://wordpress.org/support/plugin/insert-php-code-snippet/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/insert-php-code-snippet/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/insert-php-code-snippet/reviews/)

 * 0 replies
 * 1 participant
 * Last reply from: [wan1402](https://wordpress.org/support/users/wan1402/)
 * Last activity: [8 years, 4 months ago](https://wordpress.org/support/topic/could-not-use-pdo-with-command/)
 * Status: not resolved