Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New Coder
    Join Date
    Aug 2005
    Posts
    78
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Tables appear partway down the browser!

    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?

  • #2
    Regular Coder
    Join Date
    Sep 2005
    Location
    Liverpool
    Posts
    226
    Thanks
    0
    Thanked 0 Times in 0 Posts
    can we see the page in question?

    There could be many reasons, but without seeing it we would be ****ing in the dark :-)
    my mind is on a permanent tangent

  • #3
    New Coder
    Join Date
    Aug 2005
    Posts
    78
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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.

  • #4
    Regular Coder
    Join Date
    Sep 2005
    Location
    Liverpool
    Posts
    226
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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.
    my mind is on a permanent tangent


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •