Wordpress Themes - WP Forum at BFA

Wordpress Themes - WP Forum at BFA (http://forum.bytesforall.com/index.php)
-   Atahualpa 3 Wordpress theme (http://forum.bytesforall.com/forumdisplay.php?f=2)
-   -   [SOLVED] Atahualpa Gets MySQL Error Message (http://forum.bytesforall.com/showthread.php?t=11050)

lcreid Nov 8, 2010 06:21 PM

[SOLVED] Atahualpa Gets MySQL Error Message
 
I get the following error message when I try to use the Atahualpa theme on a brand-new Wordpress site (nothing done after the install but switch to Atahualpa). This happens on two commercial hosting services. When I run the site on my own box, it works fine. The hosts that don't work are the newest and oldest versions of PHP and MySql. My own box, which works, has versions of PHP and MySql in between.

The message in the error log is:

[08-Nov-2010 17:07:13] WordPress database error You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'ASC' at line 1 for query SELECT * FROM wp_sb_posts WHERE (post_type = 'page' AND post_status = 'publish') ORDER BY ASC made by require, require_once, include, get_header, locate_template, load_template, require_once, bfa_header_config, bfa_hor_pages, wp_list_pages, get_pages

Any hints as to what might be wrong?

juggledad Nov 8, 2010 07:25 PM

Does the default theme work?

lcreid Nov 8, 2010 08:39 PM

Yes, the default theme works in all three situations.

juggledad Nov 9, 2010 03:37 AM

What are the versions of atahualpa, wp, mysql and php?

lcreid Nov 9, 2010 06:47 AM

Host 1 (MySql Error)
MySql version: 5.1.48
PHP version: 5.2.14
WP version: 3.0.1
Atahualpa version: 3.4.9


Host 2 (MySql Error)
MySql version: 4.1.11
PHP version: 4.4.8-0.dotdeb.0
WP version: 3.0.1
Atahualpa version: 3.4.9


Host 31 (No MySql Error)
MySql version: 5.0.51a
PHP version: 5.2.4-2ubuntu5.3
WP version: 3.0.1
Atahualpa version: 3.4.9

juggledad Nov 9, 2010 06:52 AM

from the wordpress page (http://wordpress.org/about/requirements/)
Quote:

To run WordPress your host just needs a couple of things:
PHP version 4.3 or greater
MySQL version 4.1.2 or greater
your host2 is at 4.1.11

lcreid Nov 9, 2010 06:39 PM

Fair enough. But Host 1 is the most up-to-date, and it gets the same error.

I grepped all the code, but it appears the SQL queries are built up in pieces, so it's hard to identify exactly where the query is being built and executed. If you recognize where that query comes from and give me a file and line number, I can put some debugging statements in and trace back to hopefully find the error.

juggledad Nov 9, 2010 07:22 PM

what is the database table prefix? is it wp_sb?

I've been trying to find out where this is being created also...

try turning debug on in wp-config.php

I could be the code in post.php about line 3171 where it builds a query

lcreid Nov 9, 2010 07:40 PM

I set the prefix to wp_sb_ because on one of the hosts I don't have the luxury of creating another database. I'll check if the prefix is different on the machine that works a little later. The machine that works isn't accessible from where I am right now.

I tried turning on debug in the wp-config.php but to my untrained eye it didn't give me enough info to narrow down the search.

I appreciate your help. Let me know if I can send any more information.

lcreid Nov 9, 2010 08:23 PM

Okay. This may be my bad. Both Host 1 and Host 3 produce the same output when run without debug messages. However, when I run them with debug messages turned on, the host with the new versions of PHP and MySql does not give the database error. So the PHP version may be the issue for one of the hosts, but the other host still has some issue.

I'll try to confirm and provide a bit more information later this evening.

lcreid Nov 9, 2010 08:24 PM

Sorry again. In the previous message I meant both Hosts 1 and 2. The working host always works. Only one of the two non-working hosts appears to produce the MySql error message.

lcreid Nov 9, 2010 09:43 PM

So, on Host 1, which doesn't display the default WordPress install with Atahualpa correctly, I get the following in the error log if I run the "preview" of the Atahualpa theme:

Code:

[10-Nov-2010 04:38:59] PHP Notice:  Undefined variable: logo_icon_text in /home/jade3201/public_html/swan/wp-content/themes/atahualpa/functions/bfa_theme_options.php on line 528
[10-Nov-2010 04:38:59] PHP Notice:  Undefined variable: header_image_text in /home/jade3201/public_html/swan/wp-content/themes/atahualpa/functions/bfa_theme_options.php on line 652
[10-Nov-2010 04:38:59] PHP Notice:  Undefined variable: widget_form_string in /home/jade3201/public_html/swan/wp-content/themes/atahualpa/functions/bfa_theme_options.php on line 1921
[10-Nov-2010 04:38:59] PHP Notice:  register_sidebar_widget is <strong>deprecated</strong> since version 2.8! Use wp_register_sidebar_widget() instead. in /home/jade3201/public_html/swan/wp-includes/functions.php on line 3237
[10-Nov-2010 04:38:59] PHP Notice:  register_widget_control is <strong>deprecated</strong> since version 2.8! Use wp_register_widget_control() instead. in /home/jade3201/public_html/swan/wp-includes/functions.php on line 3237
[10-Nov-2010 04:38:59] PHP Notice:  register_sidebar_widget is <strong>deprecated</strong> since version 2.8! Use wp_register_sidebar_widget() instead. in /home/jade3201/public_html/swan/wp-includes/functions.php on line 3237
[10-Nov-2010 04:38:59] PHP Notice:  register_widget_control is <strong>deprecated</strong> since version 2.8! Use wp_register_widget_control() instead. in /home/jade3201/public_html/swan/wp-includes/functions.php on line 3237
[10-Nov-2010 04:38:59] PHP Notice:  register_sidebar_widget is <strong>deprecated</strong> since version 2.8! Use wp_register_sidebar_widget() instead. in /home/jade3201/public_html/swan/wp-includes/functions.php on line 3237
[10-Nov-2010 04:38:59] PHP Notice:  register_widget_control is <strong>deprecated</strong> since version 2.8! Use wp_register_widget_control() instead. in /home/jade3201/public_html/swan/wp-includes/functions.php on line 3237
[10-Nov-2010 04:39:00] PHP Notice:  Undefined index:  javascript_compress in /home/jade3201/public_html/swan/wp-content/themes/atahualpa/js.php on line 9
[10-Nov-2010 04:39:00] PHP Notice:  Undefined index:  javascript_compress in /home/jade3201/public_html/swan/wp-content/themes/atahualpa/js.php on line 235
[10-Nov-2010 04:39:00] PHP Notice:  Use of undefined constant gallery_styles - assumed 'gallery_styles' in /home/jade3201/public_html/swan/wp-content/themes/atahualpa/functions.php on line 149
[10-Nov-2010 04:39:00] PHP Notice:  Undefined variable: page_menu_bar in /home/jade3201/public_html/swan/wp-content/themes/atahualpa/functions/bfa_header_config.php on line 360
[10-Nov-2010 04:39:00] PHP Notice:  Undefined variable: page_menu_bar in /home/jade3201/public_html/swan/wp-content/themes/atahualpa/functions/bfa_header_config.php on line 361
[10-Nov-2010 04:39:00] PHP Notice:  Undefined variable: page_menu_bar in /home/jade3201/public_html/swan/wp-content/themes/atahualpa/functions/bfa_header_config.php on line 362
[10-Nov-2010 04:39:00] PHP Notice:  Undefined variable: cat_menu_bar in /home/jade3201/public_html/swan/wp-content/themes/atahualpa/functions/bfa_header_config.php on line 363
[10-Nov-2010 04:39:00] PHP Notice:  Undefined variable: cat_menu_bar in /home/jade3201/public_html/swan/wp-content/themes/atahualpa/functions/bfa_header_config.php on line 364
[10-Nov-2010 04:39:00] PHP Notice:  Undefined variable: cat_menu_bar in /home/jade3201/public_html/swan/wp-content/themes/atahualpa/functions/bfa_header_config.php on line 365
[10-Nov-2010 04:39:00] PHP Notice:  Undefined variable: logo_area in /home/jade3201/public_html/swan/wp-content/themes/atahualpa/functions/bfa_header_config.php on line 366
[10-Nov-2010 04:39:00] PHP Notice:  Undefined variable: header_image in /home/jade3201/public_html/swan/wp-content/themes/atahualpa/functions/bfa_header_config.php on line 367
[10-Nov-2010 04:39:00] PHP Notice:  Undefined variable: horizontal_bar1 in /home/jade3201/public_html/swan/wp-content/themes/atahualpa/functions/bfa_header_config.php on line 368
[10-Nov-2010 04:39:00] PHP Notice:  Undefined variable: horizontal_bar2 in /home/jade3201/public_html/swan/wp-content/themes/atahualpa/functions/bfa_header_config.php on line 370
[10-Nov-2010 04:39:00] PHP Notice:  Undefined index:  postcount in /home/jade3201/public_html/swan/wp-content/themes/atahualpa/index.php on line 6
[10-Nov-2010 04:39:00] PHP Notice:  Undefined index:  postcount in /home/jade3201/public_html/swan/wp-content/themes/atahualpa/index.php on line 13
[10-Nov-2010 04:39:00] PHP Notice:  Undefined index:  center_content_bottom in /home/jade3201/public_html/swan/wp-content/themes/atahualpa/index.php on line 38

Note, no MySql error.

lcreid Nov 9, 2010 11:05 PM

On the hosts that aren't working, the Atahualpa css isn't getting put on the page. On the host that is working, a large part of the css is being put on one line. I see this by doing view source on the page. I'll give a better description tomorrow.

juggledad Nov 10, 2010 06:03 AM

None of those PHP notices are an issue

can you send me (in a PM if you want) the url of host1?
the css on one line is normal and based on the settings at ato->Configure CSS & JS

Did you try putting some debug code near where I said I thought the SQL statement is being built? in wordpress/wp-includes/post.php about line 3171 where it builds a query.

lcreid Nov 10, 2010 06:54 AM

I found several post.php files, but only one was big enough to have a line 3171. I put an error_log statement there, but nothing appeared in the log.

juggledad Nov 10, 2010 08:14 AM

Can you give me acces to take a look?

lcreid Nov 10, 2010 06:11 PM

I can give you the URL of the host that doesn't work, but I can't give you access to the code behind it. I can't give you access to the host that works, either. Sorry. The host that doesn't work is at http://jadesystems.ca/swan.

juggledad Nov 10, 2010 06:23 PM

Go to the backend ato->export/import settings at the bottom of the page you will see a button labeled 'delete bfa_ata4' -press the button and see what happens

Oh and turn off debug mode

lcreid Nov 11, 2010 08:08 AM

I can't find such a button on the page you mentioned (I assume you mean Atahuala Theme Options, Export/Import Settings).

I've turned off debug.

lcreid Nov 11, 2010 08:26 AM

I should have done this before, but... I did a clean install of Wordpress in another directory and database on the "good" host and Atahualpa works fine. I built the non-functioning site by copying the site from the other host, which had the old, unsupported, version of PHP. I suspect there was a cached file that was broken because of the old version of PHP, that I copied to the other host.

Thanks for all your help. It was your comment about deleting bfa_ata4 that got me thinking about cached files. We can call this closed, with the root cause being trying to run WordPress on an unsupported version of PHP.


All times are GMT -6. The time now is 07:30 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.