PEAR is archived and read-only

This mirror preserves historical PEAR package releases and metadata so existing references remain available.

Home » Database » DB » Bug #4500

php bear crash with euro

Details

Submitted2005-06-01 08:47 UTC
Fromruben at rentalia dot com
Assigneddanielc
StatusBogus
PackageDB
PHP Version5.0.0
OSLinux
Roadmaps(Not assigned)

Comments

[2005-06-01 08:47 UTC] ruben at rentalia dot com

Description:
------------
Database: Postgres

If I insert € character, and the SELECT, and set locale iso8859-1, DB crash when u try to fetch data.

Reproduce code:
---------------
Line 554:
if ($qry_topOpi->numRows() > 0) { ?>

Expected result:
----------------
Should not crash

Actual result:
--------------
Fatal error: Call to undefined method DB_Error::numRows() in /var/www/rentalia/houses/topten.php on line 554

[2005-06-01 13:39 UTC] ruben at rentalia dot com

The query has a return value.

If u edit the content, and adds a '€' at any row (that matchs with WHERE clause), crash.

If u delete the '€' in the content, and refresh, it works.

Try it yourself. But anyway im gonna try to catch the error and i ll back and post it.

[2005-06-01 13:48 UTC] ruben at rentalia dot com

Code:

if (DB::isError($qry_topOpi)) {
echo $qry_topOpi->getDebugInfo() . "\n";
}

if ($qry_topOpi->numRows() > 0) { ?>

Error:

[nativecode=ERROR: could not convert UTF-8 character 0x00e2 to ISO8859-1]
Fatal error: Call to undefined method DB_Error::numRows() in /var/www/rentalia/houses/topten.php on line 559

[2005-06-01 13:55 UTC] ruben at rentalia dot com

Sure?

Now we have a mix in the web. We have some soldfusion and we a migrating to php.

With colfusion script it works.

[2005-06-01 14:31 UTC] ruben at rentalia dot com

Ok then. Thanks a lot. But,

i think that somethink should be done to prevent to crash, because with another programming languages does not matther ...

[2005-06-02 06:57 UTC] ruben at rentalia dot com

Hi again.

Ok, u have the reason, there is not crash :P

About postgtres, is the same database, the same version (we are mixing old cf with new php, the web is so big and we can't migrate in one)

Postgres data is stored in UTF-8. About charset in CF I have no idea, CF is a shadow, somehow its converted. Maybe uses the locale in apache as reference, it has been set in ISO-8859-15

PHP uses apaches's if it has not been specified in php.ini ...

I didnt set locale in script.