...

View Full Version : Tables appear partway down the browser!



zonkd
02-07-2006, 08:54 PM
The records in the mysql db are fed into a table on the webpage, and are sorted by category. So you can go from one page to another, depending on the category you choose.

But - it's not happened before with me - on some of the pages, the table appears part-way down the page, as if I had masses of <p></p> there. Of course, I don't.

Anyone had this trouble before and found the answer, please?

Rich Pedley
02-07-2006, 09:30 PM
can we see the page in question?

There could be many reasons, but without seeing it we would be ****ing in the dark :-)

zonkd
02-08-2006, 09:53 AM
Hi Rich
Basically, it's the same as I have repeated many times. Yet when the results appear on the browser, it appears partway down the page - perhaps equivalent to about 14 rows.


$query = "SELECT name, title, age, job, qualif, ref FROM connex_opp WHERE cat = 't' ";
echo '<p> </p>';
$result = @mysql_query ($query); // Run the query.
$num = mysql_num_rows ($result); // how many users do we have
if ($num > 0) { //if it ran ok, show the records
echo "<h1 class=\"medium\">Technical ($num)</h1>";
echo ' <table align="center" cellspacing="0" class="stats">
<tr>
<td align="left"><b>Company and location</b></td>
<td align="left"><b>Job title</b></td>
<td align="left"><b>Age</b></td>
<td align="left"><b>Job description</b></td>
<td align="left"><b>Qualifications needed</b></td>
<td align="left"><b>Ref no.</b></td><br>
</tr>
';
// Fetch and print all the records.
while ($row = mysql_fetch_array($result, MYSQL_NUM))
{
echo "<tr>
<td align=\"left\">" . stripslashes($row[0]) . "</td>
<td align=\"left\"> $row[1]</td>
<td align=\"left\"> $row[2]</td>
<td align=\"left\"> $row[3]</td>
<td align=\"left\"> $row[4]</td>
<td align=\"left\"> $row[5]</td><br>
</tr>
\n";
}
echo '</table>';
mysql_free_result ($result); // Free up the resources.
}
else
{ // If it did not run OK.
echo '<p>There are no current users, sorry.</p><p>' . mysql_error() . '</p>';
}
mysql_close(); // Close the database connection.

Rich Pedley
02-08-2006, 12:19 PM
erm, not the code but the actual web page produced.

Preferably one with the problem, and one without.

Apart from needing to learn CSS there doesn't appear to be anything sticking out like a sore thumb in your code.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum