Re: Fw: select * from table not showing everything

Поиск
Список
Период
Сортировка
От Guillaume Lelarge
Тема Re: Fw: select * from table not showing everything
Дата
Msg-id 46344BED.4000801@lelarge.info
обсуждение исходный текст
Ответ на Fw: select * from table not showing everything  (Richard Dunne <richarddunne1971@yahoo.com>)
Список pgsql-php
Richard Dunne a écrit :
> I am still at a loss.  I deleted everything from the table using
> delete from table;
> I then added a row using the php method with the php webpage.  I then checked the table with
> select * from table;
>
> this being the result
>
>
>  name | address | contact_no
> ------+---------+------------
>       |         |
> (1 row)
>
> As you can see its detecting an entry in the table but it is not displaying the entry.
> Can anyone advise?  I am only geussing at a configuration problem?
>

Perhaps because empty strings were send. You're not telling us your PHP
version. If you have 4.2.0 or later, register_globals is by default
disabled and $customer_name, $customer_address and $customer_contact_no
won't be registered. You'll need to use $_GET array to get those values.
Moreover, you don't escape strings.

Maybe you should try this
   $query  = "insert into customer values(";
   $query .= "'" . pg_escape_string($_GET['customer_name']) . "', ";
   $query .= "'" . pg_escape_string($_GET['customer_address']) . "', ";
   $query .= "'" . pg_escape_string($_GET['customer_contact_no']) . "')";
   $result = pg_query($connect, $query);
and read this
   http://www.php.net/language.variables.predefined

Regards.


--
Guillaume.
<!-- http://abs.traduc.org/
      http://lfs.traduc.org/
      http://docs.postgresqlfr.org/ -->

В списке pgsql-php по дате отправления:

Предыдущее
От: Richard Dunne
Дата:
Сообщение: Fw: select * from table not showing everything
Следующее
От: Jeff Lanzarotta
Дата:
Сообщение: Re: php-pgsql no longer works under 8.2