PhpDig.net

Go Back   PhpDig.net > PhpDig Forums > Troubleshooting

Reply
 
Thread Tools
Old 05-12-2005, 02:25 AM   #1
corsc
Green Mole
 
Join Date: May 2005
Posts: 4
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
corsc is offline   Reply With Quote
Old 05-12-2005, 07:32 AM   #2
Charter
Head Mole
 
Charter's Avatar
 
Join Date: May 2003
Posts: 2,539
Can you go back to the original code and echo out the $soundex_query and add "or die(mysql_error());" to $soundex_results?
__________________
Responses are offered on a voluntary if/as time is available basis, no guarantees. Double posting or bumping threads will not get your question answered any faster. No support via PM or email, responses not guaranteed. Thank you for your comprehension.
Charter is offline   Reply With Quote
Old 05-18-2005, 06:14 PM   #3
corsc
Green Mole
 
Join Date: May 2005
Posts: 4
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.
corsc is offline   Reply With Quote
Old 05-19-2005, 06:42 AM   #4
Charter
Head Mole
 
Charter's Avatar
 
Join Date: May 2003
Posts: 2,539
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.
__________________
Responses are offered on a voluntary if/as time is available basis, no guarantees. Double posting or bumping threads will not get your question answered any faster. No support via PM or email, responses not guaranteed. Thank you for your comprehension.
Charter is offline   Reply With Quote
Old 05-23-2005, 06:46 PM   #5
corsc
Green Mole
 
Join Date: May 2005
Posts: 4
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)
corsc is offline   Reply With Quote
Old 05-26-2005, 08:54 AM   #6
Charter
Head Mole
 
Charter's Avatar
 
Join Date: May 2003
Posts: 2,539
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?
__________________
Responses are offered on a voluntary if/as time is available basis, no guarantees. Double posting or bumping threads will not get your question answered any faster. No support via PM or email, responses not guaranteed. Thank you for your comprehension.
Charter is offline   Reply With Quote
Old 06-01-2005, 08:24 PM   #7
corsc
Green Mole
 
Join Date: May 2005
Posts: 4
sorry, yeah that was a typo
corsc is offline   Reply With Quote
Old 06-01-2005, 11:24 PM   #8
Charter
Head Mole
 
Charter's Avatar
 
Join Date: May 2003
Posts: 2,539
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.
__________________
Responses are offered on a voluntary if/as time is available basis, no guarantees. Double posting or bumping threads will not get your question answered any faster. No support via PM or email, responses not guaranteed. Thank you for your comprehension.
Charter is offline   Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Running phpdig cloefke Troubleshooting 0 07-05-2007 12:00 PM
"Error_reporting(E_ALL);" Gives no output... x86m4nn Coding & Tutorials 1 03-15-2005 09:23 AM
$argc and $argv are empty when running spider.php from the shell bsw114 Mod Submissions 1 02-20-2004 07:52 AM
running out of memory tomas External Binaries 11 02-19-2004 11:12 AM
Script running on its own? druesome Troubleshooting 1 10-26-2003 09:15 AM


All times are GMT -8. The time now is 05:40 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright © 2001 - 2005, ThinkDing LLC. All Rights Reserved.