We encountered a problem. The reason reported was Script: Line#: SQL 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 '' at line 3 SQL Error #: 1064 Query: select count(*) from ubbt_POSTS WHERE POST_POSTED_TIME >
Please use your back button to return to the previous page
------------------
This was when trying to make a new post in a forum...
People seem to be psoting in other forums - this forum can only have posts started by admins (it is a site news forum)
The post was posted fine, despite the error.
I have posted in an admin forum as a test and all was fine.
Express Hosting
"We are the official hosting company of UBB.threads. Ask us about our free migration services to migrate your UBB.threads installation."
#173615 - 01/15/0710:56 AMRe: Anyone recognise this error?
[Re: Ian]
Registered: 06/05/06
Posts: 14994
Loc: Portland, OR; USA
Query: select count(*) from ubbt_POSTS WHERE POST_POSTED_TIME >
It looks like it failed when trying to count the number of posts before a specific time, such as for the "latest posts in thread" opion that shows at the thread listing; it looks like the time wasn't included or something?
Registered: 06/04/06
Posts: 10164
Loc: Aberdeen, WA
Looking at this again, the query seems to be a bit incomplete. That would give the total # of new posts in all forums older than a new date. I'm trying to locate where we even do a query like that.
Registered: 06/04/06
Posts: 10164
Loc: Aberdeen, WA
Ok, I've been searching through all of the scripts and I can't find any query like this. The scripts that check for unread posts all specify an individual forum and use a join in the process, so they look more like "and t1.POST_POSTED_TIME > "
There is no query in the default code that I can find anywhere that executes a query like this.
Ok, I've been searching through all of the scripts and I can't find any query like this. The scripts that check for unread posts all specify an individual forum and use a join in the process, so they look more like "and t1.POST_POSTED_TIME > "
There is no query in the default code that I can find anywhere that executes a query like this.
Don't have the code with me, but what about cache_builders/forum_stats.php
Rick - when I first had this problem it was just after I had installed Ian's modification to forum_stats.php.
However this was a fresh install - I did various things to correct the issue, including re-uploading. Whether re-uploading this file did the trick I do not know.
Well yeah, that's my query, but if that was causing it it'd imply either an issue with $html->get_date(), php's ability to subtract, or $dbh->do_placeholder_query(). What bothers me is that I'm anal about using the __LINE__ and __FILE__ parameters in queries, so those for some reason weren't getting added into the error
We encountered a problem. The reason reported was Script: /home/virtual/site5/fst/var/www/html/forums/scripts/showflat.inc.php Line#: 226 SQL Error: Can't open file: 'ubbt_POSTS.MYD'. (errno: 145) SQL Error #: 1016 Query: SELECT t1.TOPIC_ID,t1.FORUM_ID,t1.TOPIC_LAST_REPLY_TIME,t1.TOPIC_IS_STICKY,t1.POST_ID FROM ubbt_TOPICS as t1, ubbt_POSTS as t2 WHERE t2.POST_ID = 85993 AND t1.TOPIC_ID = t2.TOPIC_ID
Please use your back button to return to the previous page.
Will doing a repair on the ubbt_posts.myd table solve the problem? It isn't showing any rows with only 1B in both data_length and index_length columns.
I am ready to use the repair table ubbt_posts command, however, I want to make sure this is ok to do before I do it as I can't afford to mess up on such a critical table as I don't want to lose all the posts data.
Registered: 06/05/06
Posts: 14994
Loc: Portland, OR; USA
MySQL tables/databases can become currupted for any number of reasons; server crashes, insufficient space, etc; it all honestly varies case by case.
For most cases you can repair the database with built in command tools, such as the "myisamchk" tool I linked to in my previous post.
In a lot of cases, a simple "repair" via the MySQL command can fix a lot of issues; however, running this or any SQL maintenance from a web browser is highly not advised by me, it will take forever, doing such tasks from the command line will highly improve wait times here as you'll not be bogging down (or be bogged down by) the webserver to execute MySQL commands and recieve feedback.
Not to do a thread hijack here, but is there a resource for preventative measures that a n00b MySQL admin should take for the UBB data? I back it up (via the web interface) daily. Are there consistency checks or other things that I should be doing?
Registered: 06/04/06
Posts: 10164
Loc: Aberdeen, WA
Table corruption can happen from a variety of things. It's more prone to happen on a shared server. Some of the reasons would include:
Hardware issues, motherboard/cpu/memory or a slow/bad hard drive.
The mysql process being killed while the database is being written to.
The computer/server being shutdown unexpectedly.
Certain versions of MySQL have bugs in them that are more prone to corruption. So, it's important for the host to be on top of things and upgrade accordingly.
In short, the more stable and up to date the server is the less frequently you should have table crashes. For example, here, we haven't had a single table crash.
There are no real preventative steps that can be taken. If you have frequent corruption issues, then it's more than likely related to something above.
Having a properly tuned mysql server can help. If you're on a hosting company that just throws up a mysql server and uses the default configuration, that certainly isn't going to help, especially if you're using shared hosting.
Registered: 06/04/06
Posts: 10164
Loc: Aberdeen, WA
When they are backing up the table it very well could be taxing MySQL heavily and contributing to the problem.
As for restoring a backup table. You could use something like phpmyadmin to drop the old table (not the entire database) and then import the backup table.
As this happened the last two Saturdays, I will do a backup of that table on Friday evening, or first thing Saturday morning, and, if it happens again, I will drop that table and import the backup one via phpmyadmin.