WordPress.org

Ready to get started?Download WordPress

Forums

Search error when no matches found (3 posts)

  1. poper
    Member
    Posted 9 years ago #

    Ok, I'm a newbie who has tried to mod the template, obviously I've crashed it... :( everything works fine but every time I search for a word and there aren't no results I get this error:
    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 '' at line 3]
    SELECT category_id, cat_name, category_nicename, category_description, category_parent FROM wp_categories, wp_post2cat WHERE wp_post2cat.category_id = cat_ID AND wp_post2cat.post_id =
    Warning: Invalid argument supplied for foreach() in /home/pop-page/public_html/articulos/wp-includes/template-functions-category.php on line 65
    I know it's a problem with my index.php modifications because if I replace it with the default index.php, there's no search error. But I 've no idea which part of the index.php code is wrong (I can paste it if you ask).
    Any suggestion, please?

  2. carthik
    Member
    Posted 9 years ago #

    I beleive that index.php asks for a cateogry that does not exist, or does not supply complete info to the file referenced in the error.
    Whatever you changes with regard to the category display may be what's borking the index. You could check that.

  3. poper
    Member
    Posted 9 years ago #

    Fixed. You were right. I put <?php the_category() ?> outside the loop and that was causing the problem.
    Thanks a lot.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.