ID:               22636
 User updated by:  real_mctl at yahoo dot fr
 Reported By:      real_mctl at yahoo dot fr
 Status:           Bogus
 Bug Type:         MySQL related
 Operating System: Linux Red Hat 7.2
 PHP Version:      4.3.1
 New Comment:

<?
        function fSelectionnerNiveauSuivi(&$tabNiveauSuivi)
        {
                $succes=false;
                if ( ($idLienCnx=fConnecterBase(CONFIG_SUJET)) != false) //
fConnecterBase() works properly, parses a constant who contains
identifiers for the connection to the database
                {
                        if (($resultat = fSelectNiveauSuivi($idLienCnx))!= false) 
                        {
                                $succes=true;
                                while ($ligne=mysql_fetch_object($resultat))
                                {
                                        
$tabNiveauSuivi['idNiveauSuivi'][]=$ligne->idNiveauSuivi;
                                        $tabNiveauSuivi['nom'][]=$ligne->nom;
                                                                
                                }
                                $succes = fLiberer($resultat,$succes); // fLiberer() 
free the
memory (works properly)
                        }
                        $succes=fDeconnecterBase($idLienCnx,$succes); // 
fDeconnecterBase()
close the connection with the base
                }
                return $succes ;
        }

        function fSelectNiveauSuivi($idLienCnx)
        {
                $requete="SELECT * FROM NiveauSuivi ORDER BY nom ";
                $resultat=fEmettreRequete($requete,$idLienCnx) ;
                return $resultat ;
        }

        function fEmettreRequete($requete,$idLienCnx) 
        {
                // Emission de la requête
                $resultat = @mysql_query($requete,$idLienCnx);
                
                if ($resultat==false) 
                {
                        // Requête en erreur
                        fEnregistrerErreur(mysql_errno(), mysql_error() . " Requete:" .
$requete) ; // fEnregistrerErreur() mails the webmaster that an error
occured when quering the database
                }
                
                // Retour
                return $resultat ;
        }

        $succes = fSelectionnerNiveauSuivi(&$tabNiveauSuivi) ;
?>

OK !
The script works perfect with PHP 4.1.2 but with 4.3.1, it does not
work
One other detail : the functions listed above are in different include
files and the include instruction is always called when necessary.
After all, if I reload the page with the script, i have no problem

Is this bogus again ??

Thanks


Previous Comments:
------------------------------------------------------------------------

[2003-03-11 20:39:34] [EMAIL PROTECTED]

Can't reproduce. You're doing something wrong obviously.


------------------------------------------------------------------------

[2003-03-11 14:40:06] real_mctl at yahoo dot fr

no need to copy the entire code (huge app).
the code before and after mysql_query is correct.

------------------------------------------------------------------------

[2003-03-11 11:20:17] [EMAIL PROTECTED]

And add a _FULL_ but short example script here, not just 2 lines from
one..


------------------------------------------------------------------------

[2003-03-11 11:19:37] [EMAIL PROTECTED]

huh? What if you remove that @ from the mysql_query() call?


------------------------------------------------------------------------

[2003-03-11 10:21:14] real_mctl at yahoo dot fr

It's simple, my entreprise updated the version of PHP, from 4.1.2 to
4.3.1.
The problem is that when the function mysql_query is executing some
query, this function overwrite all data on my PHP script even the query
itself !

An example (the query is indeed correct) :

$query = "select * from table" ;
$result = @mysql_query($query,$idCnx) ;
The execution of the query crashes, return 1 (don't return a ressource
id) and owerwrite the content of $query to an empty value !


Thanks

------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=22636&edit=1

Reply via email to