Page 2 of 3 FirstFirst 123 LastLast
Results 11 to 20 of 21

Thread: SQL error when activate pruning

  1. #11
    Veteran taylerj's Avatar
    Join Date
    Apr 2009
    Location
    Las Vegas, NV
    Posts
    380
    Thanks
    1
    Thanked 8 Times in 6 Posts

    Re: SQL error when activate pruning

    I do understand what your saying, but you must understand no one here is getting paid. before you buy the theme if you look under where it talks about support youll see that it does say the support is community driven, which means me and other like me. What i dont understand is how you react when you didnt get help. Im sorry but even in your shoes i don't see it has a reason to act has you and the other person on the forums have. This is why i have not wanted to help you. If you would have just accepted my first apologizes and left it at that i would have helped you but you decided to run off and start talking about me and my team. If another person wants to help you fine, but id much rather help someone that would be grateful, and not go around talking about me and my team because we get busy at times.

    To show you a little what i mean let me tell you about my day, and just about every day. I got up at 4am, got ready got my 20 month old baby ready (im a single parent so i have no help). I then leave for work about 5am. I work in construction so its not a sit at desk job, im active all day outside, in the weather working. I just got home from work at 6pm. Thats 12 hours i work each day, now i must cook supper for me and my child, get her ready, play with her a bit and get her to bed. After i get all this done and get my daily chores done it will be about 8-9pm and chances are i wont feel like helping mysef, much less anyone else. Also not to mention i own 12 very productive sites and im working at opining another big one in the next 2 weeks. If you feel the need to talk bad about me, or look down on me because i cant drop all this and help you. i am so truly sorry.

    This is enough about the subject though i will be saying no more about it. If this subject gets carried about more i will delete the post and ban the user. This forum is for support, and not debating what mods do every second of their life.
    Eric is best known in the forum for his in depth tutorials. He started in design 4 years ago and then discovered WordPress and has been coding and hacking themes and plugins ever since. He's quite helpful if you have any questions for him in the forum. Eric also makes his own WordPress themes and plugins and provides ClassiPress consulting on the side. David Cowgill - (Owner of Classipress)

  2. #12
    Founder dcowgill's Avatar
    Join Date
    Mar 2009
    Location
    San Francisco, CA
    Posts
    1,939
    Thanks
    66
    Thanked 135 Times in 99 Posts

    Re: SQL error when activate pruning

    Hi Juanjo-

    I'm sorry you haven't had your issue resolved yet and I don't like seeing people who can't get their site working correctly.

    Most of the time it has to do with different versions of mysql, php, wordpress, or restrictions of your web hosting provider. In your case, I believe it has to do with the date format not matching your current setup. If you edit index.php and look at line 150 (like the error message says) you'll see a date format of "Y-m-d h:i:s". In your country the date display might be different so it's causing an error.

    If you go into your wordpress admin section to wp-admin/options-general.php, what is the date format you see there?

    Tayler, thanks for responding to Juanjo and volunteering your time to assist him.

  3. #13
    Founder dcowgill's Avatar
    Join Date
    Mar 2009
    Location
    San Francisco, CA
    Posts
    1,939
    Thanks
    66
    Thanked 135 Times in 99 Posts

    Re: SQL error when activate pruning

    Also, below this line in index.php:

    Code:
    $sql = "SELECT `ID` FROM $wpdb->posts WHERE `post_date`<'".date('Y-m-d h:i:s', strtotime("-$prun_period days"))."' AND `post_status`='publish' AND `post_type`='post' LIMIT 10";
    paste in this code:
    Code:
    echo $sql . '<-- sql statement';
    That will show us the exact sql statement and help us debug as well. Paste that result into your forum post.

  4. #14
    Thread Starter
    Amateur juanjo's Avatar
    Join Date
    Nov 2009
    Location
    Spain
    Posts
    11
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: SQL error when activate pruning

    Hello, thank you very much for helping me to solve the issue with my web. Ok, let's see:

    The date format in Options/General is 03/12/2009 (day/month/year)

    The hour is 11:08 (H:i)

    I have maked the change you say in index.php, the result is this:

    SELECT `ID` FROM wp_posts WHERE `post_date`<'2009-09-04 11:12:04' AND `post_status`='publish' AND `post_type`='post' LIMIT 10<-- sql statement

    Hope all of this help you to know what is happening whit the pruning option.

    Thanks in advance.

  5. #15
    Founder dcowgill's Avatar
    Join Date
    Mar 2009
    Location
    San Francisco, CA
    Posts
    1,939
    Thanks
    66
    Thanked 135 Times in 99 Posts

    Re: SQL error when activate pruning

    Thanks for posting your output. So that warning is caused by one or more of these things:

    1. Failed to connect to the database server.
    2. Failed to select the database.
    3. Failed SQL statement.

    If your wordpress is working ok, then #1 and #2 are not the issue so that leaves us with #3. Your sql statement looks ok and works fine when I use it on my site.

    Do you have lots of posts already on your site that should be expired? On your ad pruning settings, how many days do you have it set to?

    You could also try changing the date format in your code and see if that works. Change this:
    Code:
    date('Y-m-d h:i:s'
    to
    Code:
    date('m-d-Y h:i:s'

  6. #16
    Thread Starter
    Amateur juanjo's Avatar
    Join Date
    Nov 2009
    Location
    Spain
    Posts
    11
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: SQL error when activate pruning

    Hello again, thank you very much for your instructions. Yes, my wordpress site is running very well, the only problem I have until now is this about pruning.

    The problem is appearing until the first time I installed wordpress+classipress and I activated pruning. In other words, is present including without any post. I make test with 1 post, 2 posts... to 5 post at the same time. The problem is always present. I have tested with 30 days, 20, days, 1 day, 90 days.... the same result.

    Now I don't have any post published.

    I have changed the code that you said me, this is the result:

    SELECT `ID` FROM wp_posts WHERE `post_date`<'12-02-2009 02:50:37' AND `post_status`='publish' AND `post_type`='post' LIMIT 10<-- sql statement
    Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/.../wp-content/themes/classipress/index.php on line 151

    The line now is 151 because of the changes you said me, this line 151 is this:

    while ($row=mysql_fetch_array($sql)){

    Then I changed again the code to match exactly my time format (day-month-year), that is:

    date('d-m-Y h:i:s'

    And again the same:

    SELECT `ID` FROM wp_posts WHERE `post_date`<'02-12-2009 02:46:51' AND `post_status`='publish' AND `post_type`='post' LIMIT 10<-- sql statement
    Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/.../wp-content/themes/classipress/index.php on line 151

    I hope you will have another idea about what is happening. I don't know if this is useful to you: until I was waiting for support in this forum I was searching in Google for hours to see if I could read any solution of other people with the same problem as I. I did not have luck, but in my search I could see at least 2 webs online using classipress with the same sql error as me. I must say, too, that the hosting I'm using in this site is the same I have to host some other wordpress blogs that are mine, each one of this blogs is using a different database, user, template, plugins, etc. and all of these blogs are running without problem.

    Thanks in advance.

  7. #17
    Founder dcowgill's Avatar
    Join Date
    Mar 2009
    Location
    San Francisco, CA
    Posts
    1,939
    Thanks
    66
    Thanked 135 Times in 99 Posts

    Re: SQL error when activate pruning

    I'm really puzzled as to what it could be if none of that worked. You said you've got several different wordpress instances running on your database. Are you sure your wordpress table is called wp_posts?

    It actually sounds like it's working since it's pruning your posts, correct? When you changed the dates it changed them to drafts. You might just have strict error checking turned on by default on your host which would display these errors.

    Edit your functions.php and change:
    Code:
    ini_set( 'display_errors', 1 );
    to
    Code:
    ini_set( 'display_errors', 0 );
    If this is the issue, then the classipress code needs to be better written to handle this. Let me know the result after you try changing this. Here's another article related to error checking (http://www.lost-in-code.com/platforms/w ... tion-site/)

    If not, I'd like to next get access to your wordpress admin and mysql db to better troubleshoot. PM me the details if we need to go that direction.

  8. #18
    Thread Starter
    Amateur juanjo's Avatar
    Join Date
    Nov 2009
    Location
    Spain
    Posts
    11
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: SQL error when activate pruning

    If I'm not in error, I think the pruning option was not running good in the firsts test I was doing.

    I think the better option is what you say, I will send you the details in order you can access my site (wordpress dashboard, FTP and MySQL) and see what is happening.

    Thanks for all.

  9. #19
    Founder dcowgill's Avatar
    Join Date
    Mar 2009
    Location
    San Francisco, CA
    Posts
    1,939
    Thanks
    66
    Thanked 135 Times in 99 Posts

    Re: SQL error when activate pruning

    I finally figured it out after hours of testing different things. It turns out the plugin you had running called "FireStats" was causing the problem! Once I disabled it, the error message went away and everything appears to be working.

    Give it a try and let me know how it is working for you.

  10. #20
    Thread Starter
    Amateur juanjo's Avatar
    Join Date
    Nov 2009
    Location
    Spain
    Posts
    11
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: SQL error when activate pruning

    Hello David:

    First of all, as I always say, sorry about my english. I'm very grateful to you for your help. As you say, the error is not present now. Firestats is a very interesting statistics plugin that I use in all my blogs. Until now, it has not made any problem in my blogs, but as you say, now the error message don't appears!!!!

    It's time to recognize my mistakes and apologize for my part. Now I see I was in a error that is not normal in a person with some experience with Wordpress, as I. I really was thinking that the error was present in the first installation of Classipress, but it is true that I install Firestats in all my blogs from the beginning. My opinion was that the problem was in the date and time format, but now I see that I was very wrong, I never would have thought that a stats plugin could cause a failure like this.

    I want to apologize to David for having requested support for something that was a problem only mine, not of Classipress. I appreciate very much your help and I'm sorry about my behaviour last days.

    Believe me when I say I'm very sorry. Hopefully I can purge my excesses saying my good experiences with classipress on my blogs and websites to make this software better known in the Spanish world.

Page 2 of 3 FirstFirst 123 LastLast

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)