Because nobody seems to have an answer I will go into
more detail.

I use php-*4.0.2-4mdk and MySQL-3.23.23-1mdk on my Server,
there is wrong behavior of mysql_query() if I use "INSERT"
statements. This function always return 0 which means false,
even if the statement is correctly processed by mysql.

the function mysql_affected_rows() also doesn't work as
expected (always returns 0 for INSERTs)

I use apache-1.3.12-30mdk together with php.

Is this bug known? Is there a quick solution?

I don't have this bug on another system using

php-4.0.2-3mdk
MySQL-3.23.23-1mdk
apache-1.3.12-27mdk

Here is some php-code which worked before (the
mysql connection is already established)
--------------------------------------------------
if($result=mysql_query("INSERT (uid, alias) INTO users VALUES ('$uid',
'$alias')")) {
        if(mysql_affected_rows()!=1) {
                echo "This should not happen";
        }
}
else {
        echo "something was wrong with the query:
".mysql_errno().":".mysql_error();
}
--------------------------------------------------
$uid and $alias are already set and there values
are unique so that the INSERT works with no
problems.

I now get the output:

"something was wrong with the query: 0:"

That means MySQL had no error but php misinterpreted
this. Can somebody please fix this.


Jan Dittberner

Reply via email to