Hello All, I am hoping someone can help me with a problem I am having with
PHP (3.23.49) and mysql (4). My objective is to fill a table with data from
a database. My problem is that I cannot figure out why I get a gap
(noticeable with about 20 records) at the top of the page (just below the
text line) when I run the code below. In addition, the gap grows (just
slightly) with the amount of records that I retrieve from the database (the
gap will be about 7 lines with 200 records).
The code you see (which has been taken out of a larger program) is what I
needed to reproduce the problem. I know that if I take out the hidden field
the gap will be eliminated (though I am clueless why that should make a
difference) but I need the hidden field for the switch statement (part of
the code I removed).
The data in the database is regular text -nothing weird (I have tested with
a few tables and have encountered the same problem).
Any ideas...Thanks in advance.
-David
<?php
function func1(){
$id2 = @mysql_pconnect("localhost", "user", "pass");
@mysql_select_db("db1", $id2);
$query = "SELECT * FROM t1 WHERE f1= '1'";
$result = mysql_query($query);
?>
This is the top of the page. Where is this gap comming from??????
<table width="100%" border="1">
<?php
while($query_data = mysql_fetch_array($result)) { ?>
<form name="update" method="post" action="<?php echo $PHP_SELF?>">
<input type="hidden" name="op" value ="func1">
<?php
$q = $query_data ["info"]; ?>
<TR><TD WIDTH="100%" ALIGN="CENTER"><?php echo"$q";?></TD></TR>
</form>
<? } ?>
</table>
<? }
switch ($op) {
default:
func1(); break;
}
?>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php