php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #5528 Query not function properly
Submitted: 2000-07-12 07:05 UTC Modified: 2000-08-08 23:01 UTC
From: felli at ingv dot it Assigned:
Status: Closed Package: PostgreSQL related
PHP Version: 4.0.1pl2 OS: Linux RedHat 6.2
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: felli at ingv dot it
New email:
PHP Version: OS:

 

 [2000-07-12 07:05 UTC] felli at ingv dot it
If i send a query at postgresql for retrive field codice_luogo the php respond with wrong result.
The same query in pgsql work fine.

amministrazione=> \d personale 
Table    = personale
+----------------------------------+----------------------------------+-------+
|              Field               |              Type                | Length|
+----------------------------------+----------------------------------+-------+
| cognome                          | char() not null                  |    25 |
| nome                             | char() not null                  |    25 |
| titolo                           | char()                           |     6 |
| sesso                            | char() not null                  |     7 |
| data_nascita                     | date not null                    |     4 |
| codice_fiscale                   | char() not null                  |    16 |
| e_mail                           | char()                           |    40 |
| recapito_tel_1                   | char() not null                  |    20 |
| recapito_tel_2                   | char()                           |    20 |
| asl_appartenenza                 | char()                           |    10 |
| tipo_assunzione                  | char() not null                  |     1 |
| tipo_ruolo                       | char() not null                  |     2 |
| data_nomina_ruolo                | date not null                    |     4 |
| data_cessazione_ruolo            | date                             |     4 |
| motivo_cessazione_ruolo          | char()                           |    15 |
| numero_delibera_ruolo            | char() not null                  |    20 |
| tipo_assunzione_ruolo            | char() not null                  |     2 |
| codice_paga                      | int4 not null                    |     4 |
| tipo_paga                       | char() not null                  |     1 |
| quota_contanti_lire              | numeric                          | 30.6  |
| quota_contanti_euro              | numeric                          | 30.6  |
| quota_accredito_lire             | numeric                          | 30.6  |
| quota_accredito_euro             | numeric                          | 30.6  |
| codice_luogo                     | int4                             |     4 |
| indirizzo_domicilio              | char() not null                  |    30 |
| indirizzo_residenza              | char() not null                  |    30 |
| indirizzo_sede                   | char() not null                  |    30 |
+----------------------------------+----------------------------------+-------+
Index:    personale_pkey

amministrazione=> 

$quasar12=db_query("SELECT codice_luogo from personale  where codice_fiscale='$codice_fiscale'");

the codice_luogo has value 102

php query return 14, psql query return 102.

thanks for help.

bye

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-07-14 23:45 UTC] jah at cvs dot php dot net
The most probable cause of your problem is that you are confusing a result set
returned by a query with the values in result set. But your example shows that
you are using some kind of database abstraction layer too, without knowing
what it does it is quite impossible to know what goes wrong.

Please verify that you can get the correct result with PHP's native PostgreSQL API,
using pg_connect, pg_exec() and pg_fetch_row().
 [2000-08-08 23:01 UTC] waldschrott@php.net
Closed due to missing user feedback.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Apr 27 19:01:29 2024 UTC