Recent Topics

1 Jan 08, 2006 18:01    

I just noticed a search problem in my blog, and not sure where the issue is. The way my blog is currently set up, it searches only within the current blog, not across all blogs. When a search is done on a term that doesn't exist in the current blog, the search bombs out.. For example, if a search is done from my "main" blog, for the term "Prius" (which only exists in the "postmodern" blog) the page crashes in mid-render, with the error:

MySQL 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 ') GROUP BY comment_post_ID, comment_type' at line 3(Errno=1064)

Your query:
SELECT comment_post_ID, comment_type, COUNT(*) AS type_count FROM evo_comments WHERE comment_post_ID IN () GROUP BY comment_post_ID, comment_type

This is my search block:

<div class="righttext">

<h3 class="sideItemTitle"><?php echo T_('Search') ?></h3>
<?php form_formstart( $Blog->dget( 'blogurl', 'raw' ), 'search', '', 'get', 'SearchForm' ) ?>
<p>
<input type="text" name="s" size="22" value="<?php echo htmlspecialchars($s) ?>" class="SearchField" /><br />
<input type="radio" name="sentence" value="AND" id="sentAND" <?php if( $sentence=='AND' ) echo 'checked="checked" ' ?>/>&nbsp;<?php echo T_('All Words') ?><br />
<input type="radio" name="sentence" value="OR" id="sentOR" <?php if( $sentence=='OR' ) echo 'checked="checked" ' ?>/>&nbsp;<?php echo T_('Some Word') ?><br />
<input type="radio" name="sentence" value="sentence" id="sentence" <?php if( $sentence=='sentence' ) echo 'checked="checked" ' ?>/>&nbsp;<?php echo T_('Entire phrase') ?><br />
<input type="submit" name="submit" class="SubmitButton" value="<?php echo T_('Search') ?>" /> 
</p>
</form>

</div>

Anyone know where I should look for the cause of this? It's only happening in my 'blue lunar' skin and not in my darkling skin though, and the only difference between the two is the size="xx" statement for the input field.

jj.

2 Jan 08, 2006 18:58

Weird.. it was actually a problem (which I created) related to the stickypost inclusion. I had forgotten to remove a small portion of the code for comments, from the sticky inclusion, and it was bombing the search function in a very weird way. Searches where there was a result worked fine. Searches where there was no result bombed out.

jj.

3 Jan 08, 2006 19:22

I guess it would have "bombed out" also with links to categories or archive pages that contained no posts ...


Form is loading...