Support » Fixing WordPress » Search error when no matches found

  • 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?

Viewing 2 replies - 1 through 2 (of 2 total)
  • 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.

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

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Search error when no matches found’ is closed to new replies.