Fw: Postgres 8.1.4 + PHP, hangs when querying more than 16 records!

Поиск
Список
Период
Сортировка
От babak badaei
Тема Fw: Postgres 8.1.4 + PHP, hangs when querying more than 16 records!
Дата
Msg-id 20060831095134.80186.qmail@web55206.mail.re4.yahoo.com
обсуждение исходный текст
Список pgsql-php
In addition to below; I compile postgres 7.4.12. Same thing!!! More than 16 records hangs!

----- Forwarded Message ----
From: babak badaei <badaei@yahoo.com>
To: pgsql-php@postgresql.org
Sent: Wednesday, August 30, 2006 11:25:58 PM
Subject: Postgres 8.1.4 + PHP, hangs when querying more than 16 records!

OS: Fedora Core 5
PHP: PHP 5.1.4, PHP 5.1.6, and  PHP 4.4.4 (compiled with --with-pgsql and install as binaries using YUM)
Postgres 8.1.4

This scripts works:
---------------------------------------------------------------------------------
<?php
// Connecting, selecting database
$dbconn = pg_connect("host=localhost dbname=database user=web")
   or die('Could not connect: ' . pg_last_error());

// Performing SQL query
$query = 'SELECT * FROM foobar limit 16';

$result = pg_query($query) or die('Query failed: ' . pg_last_error());


// Printing results in HTML
echo "<table>\n";
while ($line = pg_fetch_array($result, null, PGSQL_ASSOC)) {
   echo "\t<tr>\n";
   foreach ($line as $col_value) {
       echo "\t\t<td>$col_value</td>\n";
   }
   echo "\t</tr>\n";
}
echo "</table>\n";

// Free resultset
pg_free_result($result);

// Closing connection
pg_close($dbconn);
?>
---------------------------------------------------------------------------------
This script hangs:

-----------------------------------------------------------------------------------
 <?php
 // Connecting, selecting database
 $dbconn = pg_connect("host=localhost dbname=database user=web")
    or die('Could not connect: ' . pg_last_error());

 // Performing SQL query
 $query = 'SELECT * FROM foobar limit 17';

 $result = pg_query($query) or die('Query failed: ' . pg_last_error());


 // Printing results in HTML
 echo "<table>\n";
 while ($line = pg_fetch_array($result, null, PGSQL_ASSOC)) {
    echo "\t<tr>\n";
    foreach ($line as $col_value) {
        echo "\t\t<td>$col_value</td>\n";
    }
    echo "\t</tr>\n";
 }
 echo "</table>\n";

 // Free resultset
 pg_free_result($result);

 // Closing connection
 pg_close($dbconn);
 ?>
-------------------------------------------------------------------------------------



The only difference is that in the first we limit to 16 records, in the latter, to 17 (and greater hangs as well). I
triedwith three different versions of PHP, as mentioned above (PHP 5.1.4, 5.1.6, & 4.4.4) from both Apache and from the
commandline. Attempted few times each when compiled versions and binary distributions via yum. All behave the same way.
Allhang above 17 records. 

Take care! Babak.










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

Предыдущее
От: babak badaei
Дата:
Сообщение: Re: Postgres 8.1.4 + PHP, hangs when querying more than 16 records!
Следующее
От: "Gavin M. Roy"
Дата:
Сообщение: Re: Postgres 8.1.4 + PHP, hangs when querying more than 16 records!