I know that use of PHP with Apache 2.x.x is
discouraged. I use 1.3.29 for my main site.
Currently I am doing some testing with SSL
connections and because Apache 2.0.48 is
already installed on my Redhat 8.0 server
and configured with SSL I have been using
that (for testing). All my testing is done
using SSL (https://) connections.
I have seen some weird behaviour and am
curious if anyone else has seen something
like this with PHP and Apache 2.x.x
(the PHP version is 4.2.2, btw).
I have a rather simple page where I fetch
a number of rows from MySQL and put them
in a two dimensional array - the first
dimenstion corresponds to the row returned
from MySQL and the other dimension holds
the elements of the row. Later when
displaying the actual html I loop through
the array displaying each row in a <tr>
in a table.
Sometimes for no reason that I can yet
discern it will stop before displaying
all of the rows. If I look at the page
source in the browser it just ends and
the rest of the html is not displayed.
It seems rather random. It doesn't stop
in the sample place. Sometimes I get 2-3
rows, sometimes a lot more - no pattern
that I can discern yet. I am certainly
as capable of writing bugs as anyone
else but can't find any so far. And like
I said it more often than not displays
everything correctly. For what its worth
here is the MySQL code to load the array:
$query = "select pub_id, name1, city, state, added from pubs2 " .
"order by name1";
$result = mysql_query($query);
$num_rows = mysql_num_rows($result);
if ($result)
{
$rw = 0;
while ($row = mysql_fetch_array($result, MYSQL_NUM))
{
$pubs[$rw][0] = $row[0]; // pub_id
$pubs[$rw][1] = $row[1]; // name1
$pubs[$rw][2] = $row[2]; // city
$pubs[$rw][3] = $row[3]; // state
$pubs[$rw][4] = $row[4]; // added
$rw = $rw + 1;
}
mysql_free_result($result);
mysql_close();
}
Then I display it later (it gets a little
'ugly' displaying the rows cause it is wrapping
in my email):
<?php
for ($i=0;$i<$rw;$i++)
{
if (even($i))
echo "<tr bgcolor=\"#ccffff\">";
else
echo "<tr bgcolor=\"#ffffff\">";
echo "<td><a
href=\"detail.php?pub_id={$pubs[$i][0]}\">{$pubs[$i][1]}</a></td>"; //
name1
echo "<td><font size=\"-1\">{$pubs[$i][2]}</font></td>"; // City
echo "<td><font size=\"-1\">{$pubs[$i][3]}</font></td>"; // State
echo "<td><font size=\"-1\">{$pubs[$i][4]}</font></td>"; // Added
echo "</tr>\r\n";
}
echo "<tr align=\"center\"><td colspan=\"4\"><font size=\"-1\"
color=\"red\">( $rw records found )</font></td></td></tr>\r\n";
?>
// end code
Again I think this is fairly simple code. I am certainly
not trying to do anything tricky.
I guess I will configure Apache 1.3.29 with SSL if don't
come up with some explanation, but I was curious if anyone
had seen such odd behaviour like this before (not displaying
all of the page).
Thanks in advance for your opinions and advice.
lk
www.theNewAgeSite.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php