Title: getting SQL error. See &#039;logs/mysql.log&#039; when using include
Last modified: August 21, 2016

---

# getting SQL error. See 'logs/mysql.log' when using include

 *  Resolved [charles_i](https://wordpress.org/support/users/charles_i/)
 * (@charles_i)
 * [12 years, 8 months ago](https://wordpress.org/support/topic/getting-sql-error-see-logsmysqllog-when-using-include/)
 * I’m trying to add an include to a mini-calendar in my sidebar. My theme is called“
   scoop” and this is the correct path to the php file that runs the mini-calendar
   but when I enter this:
 * `include (ABSPATH . '/wp-content/themes/scoop/calendar/lcsbar.php');`
 * I get this result:
 * `SQL error. See 'logs/mysql.log'`
 * However if I enter the URL to the entire path with my domain name where ABSPATH
   is I can see the mini-calendar is there.
 * How can I get the include to work?
 * Thanks
    Charles
 * [http://wordpress.org/plugins/php-code-widget/](http://wordpress.org/plugins/php-code-widget/)

Viewing 1 replies (of 1 total)

 *  Plugin Author [Samuel Wood (Otto)](https://wordpress.org/support/users/otto42/)
 * (@otto42)
 * WordPress.org Admin
 * [12 years, 7 months ago](https://wordpress.org/support/topic/getting-sql-error-see-logsmysqllog-when-using-include/#post-4176979)
 * The include works fine. But your code in that file might be assuming that it 
   is running in a global context instead of in a function context.

Viewing 1 replies (of 1 total)

The topic ‘getting SQL error. See 'logs/mysql.log' when using include’ is closed
to new replies.

 * ![](https://ps.w.org/php-code-widget/assets/icon.svg?rev=992095)
 * [PHP Code Widget](https://wordpress.org/plugins/php-code-widget/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/php-code-widget/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/php-code-widget/)
 * [Active Topics](https://wordpress.org/support/plugin/php-code-widget/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/php-code-widget/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/php-code-widget/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [Samuel Wood (Otto)](https://wordpress.org/support/users/otto42/)
 * Last activity: [12 years, 7 months ago](https://wordpress.org/support/topic/getting-sql-error-see-logsmysqllog-when-using-include/#post-4176979)
 * Status: resolved