You are here: mysqli-trouble with MySQL5 « All PHP « IT news, forums, messages
mysqli-trouble with MySQL5

Posted by ojorus on 11/23/06 10:09

Hi;
I am using the mysqli-extension on all my database queries.
Everything worked just fine when I used MySQL 4, but when the database was
upgraded to MySQL 5 (5.0.22), I got a strange error.
Here is an example:

function example(){
global $table, $mysqli;
$min = 2;
$stmt = mysqli_prepare($mysqli, "SELECT SUM(Id) FROM $table WHERE
Id>?");
if ($stmt){
mysqli_bind_param($stmt, 'i', $min);
mysqli_execute($stmt);
mysqli_bind_result($stmt, $number);
mysqli_stmt_close($stmt);
}
else echo "failure";
}

This worked fine with mysql4, but with mysql5 i get a "proxy server error".

BUT: By removing SUM from the query, everything works fine:
$stmt = mysqli_prepare($mysqli, "SELECT Id FROM $table WHERE Id>?");

(but of course the query gives me not an interesting result).

SO: It seems that SUM messes things up, but there are noe good reasons for
it as I can see.
When I comment the line
// mysqli_bind_result($stmt, $number);
i do not get the error.

I use PHP 5.0.4, and MySQL 5.0.22. I use a tomcat server.

Any suggestions...?

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация