![]() |
Running PHP in error_reporting(E_ALL)
You probably have found this already but when you run in E_ALL mode, and search for a string that is not in the database, you will receive a warning that $soundex_results is not a valid sql resource (line 650 of search_functions.php).
This can be fixed by replacing this line with: if (is_resource($soundex_results) && mysql_num_rows($soundex_results) > 0) { Sorry if this is not the appropriate place to post patches. Regards, Corey |
Can you go back to the original code and echo out the $soundex_query and add "or die(mysql_error());" to $soundex_results?
|
certainly....but
You certainly could do that, but this may cause the result page to dispaly incorrectly or not at all... With the method I suggested I get the proper page with 'no results' found. Which is what I was after.
Thanks anyway. |
I was asking if you could go back to the original code and echo out the $soundex_query and add "or die(mysql_error());" to $soundex_results so that I might see why the query had an issue in the first place.
|
sorry, miss reead your last post. When adding the lines you suggest it complains about a SQL syntax error. Complains about:
'Q', keyqword)) = SOUNDEX(CONCAT('Q','searchterm')) LIMIT 500 This only seems to happen when no results are found Mysql Version: v12.22 Distrib 4.0.20a, for Win95/Win98 (i32) |
PhpDig 1.8.8 RC1:
Code:
$soundex_query = "SELECT keyword FROM ".PHPDIG_DB_PREFIX."keywords WHERE SOUNDEX(CONCAT(_utf8'Q',keyword)) = SOUNDEX(CONCAT('Q','".$strings[$i]."')) LIMIT 500"; Code:
$soundex_query = "SELECT keyword FROM ".PHPDIG_DB_PREFIX."keywords WHERE SOUNDEX(CONCAT('Q',keyword)) = SOUNDEX(CONCAT('Q','".$strings[$i]."')) LIMIT 500"; |
sorry, yeah that was a typo
|
After reading over this thread and checking some line numbers, you are using PhpDig 1.8.8 RC1 with MySQL 4.0.20a, but MySQL didn't come out with UTF8 support until version 4.1:
http://dev.mysql.com/doc/mysql/en/charset-unicode.html PhpDig Version 1.8.8 RC1 Requirements: http://www.phpdig.net/forum/showthread.php?t=1789 PhpDig Version 1.8.7 Requirements: http://www.phpdig.net/navigation.php?action=doc#toc3 As you are using MySQL 4.0.20a with PhpDig 1.8.8 RC1, it would seem that the query is failing because MySQL 4.0.20a doesn't understand the _utf8 bit in the query, so this isn't a bug. ;) |
All times are GMT -8. The time now is 08:42 PM. |
Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright © 2001 - 2005, ThinkDing LLC. All Rights Reserved.