PDA

View Full Version : Problem Mysql when no results


noel
10-26-2005, 07:46 AM
Hello,
When there are no results I have this error Mysql :

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/httpd/vhosts/corsica-produits.com/httpdocs/google/libs/search_functions.php on line 650


I have:

PHP 4.4.0-3
Mysql 4.1.14-3

What is wrong ?

******************

I have an over I problem, I m french, and I have problems with accents and EURO symbol in the results, there are Chinese Symbols ;(


Thank you

Noël

noel
10-26-2005, 01:41 PM
I did a fresh install of phpdig 1.8.1 what I have to change in the config file to have the same configuration as phpdig 1.8.7 for the character.
Because with phpdig 1.8.7 I didn't have any problèm whith the display of chracter and I was <meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
What I have to change in the config file to have the same ?

Thank you

Noël

I steel have the problem with mysql no results error.

Charter
10-26-2005, 11:06 PM
It seems that the query is failing because MySQL doesn't understand the _utf8 bit in the query on line 649 of the search_functions.php file. MySQL 4.1.7+ should be able to understand the query, so you might want to recheck your MySQL version. When using PhpDig 1.8.8 RC1, see the following in the config file:

// you may have to change this constant depending on the page encoding, for instance...
// define('DETECT_ORDER','UTF-8,ISO-8859-7,ASCII'); // or
// define('DETECT_ORDER','UTF-8,Windows-1251,ASCII'); // or
// define('DETECT_ORDER','UTF-8,BIG-5,ASCII'); // or
// define('DETECT_ORDER','UTF-8,JIS,KOI8-R,EUC-KR,EUC-JP,SJIS,BIG-5'); // etcetera
// the first non UTF-8 encoding in the constant that 'matches' the page is used in conversion to UTF-8.
// note that some pages can match multiple encodings even though only one encoding displays correctly.
// for example, if you do a search and see chinese characters in german text, the order is not correct.
// you may need to set/reset this constant, as there is no perfect ordering for all pages.
// furthermore, some encodings have multiple names (e.g., CP1251 like Windows-1251).
// if needed, edit the function phpdigMakeUTF8 in robot_functions.php to account for multiple names.
define('DETECT_ORDER','UTF-8,KOI8-R,JIS,SJIS,CP936,BIG-5,EUC-CN,EUC-TW,EUC-KR,EUC-JP');

If you are using PhpDig 1.8.8 RC1 and indexing ISO-8859-1 content, try the following for DETECT_ORDER and check out the comments about DETECT_ORDER in the config file:

define('DETECT_ORDER','ISO-8859-1,ASCII');

noel
10-27-2005, 07:55 AM
Is that can help somebody :

When I install PHPDIG 1.8.1 RC it didn't want to create th database, so I used PHPMYADMIN to create the database, but the database has been created with Interclassement : latin1_swedish_ci and also the tables.
So I put everywhere in the table, where there was latin1_swedish_ci I put utf8_general_ci

Now I haven't any errors ;)

Sorry for the english :santa:

Charter
10-27-2005, 09:56 AM
If you ever need to set up the tables again, and you cannot create the database using the PhpDig install, select create tables from the install, and that should install the tables into whatever database matches the input.