From:             bpelletier at alct dot ca
Operating system: Windows XP Pro
PHP version:      5.3.1
PHP Bug Type:     ODBC related
Bug description:  odbc_field_name

Description:
------------
I use odbc_connect to connect to my sql server 2005.

When I want a column where the field name longer than 31 characters,
odbc_result cuts the name to 31 characters.

I really need to know how to overrite the struct to have the possibilities
to have at least 64 characters.

Thanks for you help.

I see many bugs reporting the same but no solution are proposes.

Reproduce code:
---------------
$requete= "SELECT * FROM Usagers WHERE NomUsager = '" . $p_nomUsager .
"';";
$resultat= ExecuterRequete($requete);
ProchainEnregistrement($resultat);

for ($i=1; $i < odbc_num_fields($resultat) + 1; $i++)
    echo odbc_field_name($resultat, $i)." - ";

function ExecuterRequete($p_requete)
    {
    return odbc_exec($_SESSION['BDConnection'], $p_requete); 
    }

function ProchainEnregistrement($p_resultat)
    {
    return odbc_fetch_row($p_resultat);
    }



Expected result:
----------------
I want the full name of the fields.

Actual result:
--------------
NomUsager - NoEmployeALCT - UsagerActif - DerniereLangueUtiliseUsager -
MotDePasseUsager - AccesProgrammeGestionALCT - AccesProgrammeInternational
- AccesProgrammeFacturation - AccesGestionALCTConsulterEmploy -
AccesGestionALCTAjouterEmploye - AccesGestionALCTModifierEmploye -
AccesGestionALCTSupprimerEmploy - AccesGestionALCTConsulterRappor -
AccesInternationalConsulterClie - AccesInternationalAjouterClient -
AccesInternationalModifierClien - AccesInternationalSupprimerClie -
AccesInternationalConsulterCont - AccesInternationalAjouterContac -
AccesInternationalModifierConta - AccesInternationalSupprimerCont -
AccesInternationalConsulterProd - AccesInternationalAjouterProdui -
AccesInternationalModifierProdu - AccesInternationalSupprimerProd -
AccesInternationalConsulterCour - AccesInternationalAjouterCourti -
AccesInternationalModifierCourt - AccesInternationalSupprimerCour -
AccesInternationalConsulterComp - AccesInternationalAjouterCompte -
AccesInternationalModifierCompt - AccesInternationalSupprimerComp -
AccesInternationalConsulterTran - AccesInternationalAjouterTransp -
AccesInternationalModifierTrans - AccesInternationalSupprimerTran -
AccesInternationalConsulterCont - AccesInternationalAjouterContac -
AccesInternationalModifierConta - AccesInternationalSupprimerCont -
AccesInternationalConsulterProv - AccesInternationalAjouterProvin -
AccesInternationalModifierProvi - AccesInternationalSupprimerProv -
AccesInternationalConsulterRapp - AccesInternationalConsulterSoum -
AccesInternationalAjouterSoumis - AccesInternationalModifierSoumi -
AccesInternationalSupprimerSoum - AccesInternationalConsulterDema -
AccesInternationalAjouterDemand - AccesInternationalModifierDeman -
AccesInternationalSupprimerDema - AccesInternationalReviserDemand -
AccesConfiguration - UsagerAjoutPar - UsagerDateAjout -
UsagerDerniereMiseAJourPar - UsagerDerniereMiseAJour -

Warning: odbc_result() [function.odbc-result]: Field
AccesGestionALCTSupprimerEmploye not found in
C:\wamp\www\FIK_CE\Fonctions_PHP\Utilitaires.php on line 79

Warning: odbc_result() [function.odbc-result]: Field
AccesGestionALCTConsulterEmploye not found in
C:\wamp\www\FIK_CE\Fonctions_PHP\Utilitaires.php on line 79

Warning: odbc_result() [function.odbc-result]: Field
AccesGestionALCTConsulterRapport not found in
C:\wamp\www\FIK_CE\Fonctions_PHP\Utilitaires.php on line 79

Warning: odbc_result() [function.odbc-result]: Field
AccesInternationalModifierClient not found in
C:\wamp\www\FIK_CE\Fonctions_PHP\Utilitaires.php on line 79

Warning: odbc_result() [function.odbc-result]: Field
AccesInternationalSupprimerClient not found in
C:\wamp\www\FIK_CE\Fonctions_PHP\Utilitaires.php on line 79

Warning: odbc_result() [function.odbc-result]: Field
AccesInternationalConsulterClient not found in
C:\wamp\www\FIK_CE\Fonctions_PHP\Utilitaires.php on line 79

Warning: odbc_result() [function.odbc-result]: Field
AccesInternationalAjouterContactClient not found in
C:\wamp\www\FIK_CE\Fonctions_PHP\Utilitaires.php on line 79

...............

-- 
Edit bug report at http://bugs.php.net/?id=50623&edit=1
-- 
Try a snapshot (PHP 5.2):            
http://bugs.php.net/fix.php?id=50623&r=trysnapshot52
Try a snapshot (PHP 5.3):            
http://bugs.php.net/fix.php?id=50623&r=trysnapshot53
Try a snapshot (PHP 6.0):            
http://bugs.php.net/fix.php?id=50623&r=trysnapshot60
Fixed in SVN:                        
http://bugs.php.net/fix.php?id=50623&r=fixed
Fixed in SVN and need be documented: 
http://bugs.php.net/fix.php?id=50623&r=needdocs
Fixed in release:                    
http://bugs.php.net/fix.php?id=50623&r=alreadyfixed
Need backtrace:                      
http://bugs.php.net/fix.php?id=50623&r=needtrace
Need Reproduce Script:               
http://bugs.php.net/fix.php?id=50623&r=needscript
Try newer version:                   
http://bugs.php.net/fix.php?id=50623&r=oldversion
Not developer issue:                 
http://bugs.php.net/fix.php?id=50623&r=support
Expected behavior:                   
http://bugs.php.net/fix.php?id=50623&r=notwrong
Not enough info:                     
http://bugs.php.net/fix.php?id=50623&r=notenoughinfo
Submitted twice:                     
http://bugs.php.net/fix.php?id=50623&r=submittedtwice
register_globals:                    
http://bugs.php.net/fix.php?id=50623&r=globals
PHP 4 support discontinued:          http://bugs.php.net/fix.php?id=50623&r=php4
Daylight Savings:                    http://bugs.php.net/fix.php?id=50623&r=dst
IIS Stability:                       
http://bugs.php.net/fix.php?id=50623&r=isapi
Install GNU Sed:                     
http://bugs.php.net/fix.php?id=50623&r=gnused
Floating point limitations:          
http://bugs.php.net/fix.php?id=50623&r=float
No Zend Extensions:                  
http://bugs.php.net/fix.php?id=50623&r=nozend
MySQL Configuration Error:           
http://bugs.php.net/fix.php?id=50623&r=mysqlcfg

Reply via email to