PhpDig.net

PhpDig.net (http://www.phpdig.net/forum/index.php)
-   Troubleshooting (http://www.phpdig.net/forum/forumdisplay.php?f=22)
-   -   Running PHP in error_reporting(E_ALL) (http://www.phpdig.net/forum/showthread.php?t=2007)

corsc 05-12-2005 02:25 AM

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

Charter 05-12-2005 07:32 AM

Can you go back to the original code and echo out the $soundex_query and add "or die(mysql_error());" to $soundex_results?

corsc 05-18-2005 06:14 PM

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.

Charter 05-19-2005 06:42 AM

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.

corsc 05-23-2005 06:46 PM

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)

Charter 05-26-2005 08:54 AM

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";
PhpDig 1.8.7:
Code:

            $soundex_query = "SELECT keyword FROM ".PHPDIG_DB_PREFIX."keywords WHERE SOUNDEX(CONCAT('Q',keyword)) = SOUNDEX(CONCAT('Q','".$strings[$i]."')) LIMIT 500";
You have keyqword in the query. Was that a typo in your post?

corsc 06-01-2005 08:24 PM

sorry, yeah that was a typo

Charter 06-01-2005 11:24 PM

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.