Jump to content

How to Style data display from database using PHP? Help needed. Thanks!


bchandel

Recommended Posts

I have the following script which is working fine. I want to find the best way to display date in a page with say 1" blue border horizentally and vertically on the page to style the page display data.

 

Second how I can put pagination on the bottom of result tables?

 

<?php

 

//database connection information

 

?>

 

<html>

<head>

<style type="text/css">

.custom {font-family: Arial, Helvetica, sans-serif; }

body

{

background-color:#ffffff;

}

 

</style>

<head>

 

<body>

<h1><font color="#000080">Search Results:</font></h1>

<table border="5" width="100%" cellspacing="1" cellpadding="5" bordercolor="#000080">

      <tr>

        <th class="custom">Name</th>

        <th class="custom">Last Name</th>

        <th class="custom">First Name</th>

        <th class="custom">Phone</th>

        <th class="custom">Mobile</th>

        <th class="custom">E-mail</th>

        <th class="custom">Web Site</th>

        <th class="custom">State</th>

        <th class="custom">Country</th>

          <th class="custom">Profile</th>

      </tr>

<?php

while($d = mysql_fetch_array($result)) {

 

$d['Email'] = $d['Email'] ? "<a href='mailto:{$d['Email']}'>E-mail</a>" : "-";

$d['Web'] = $d['Web'] ? "<a href='{$d['Web']}'>Web Site</a>" : "-";

$d['Profile']= $d['Profile'] ? "<a href='{$d['Profile']}'>Profile</a>" : "-";

 

  echo "<tr>

        <td class='custom'>{$d['Name']}</td>

        <td class='custom'>{$d['LastName']}</td>

        <td class='custom'>{$d['FirstName']}</td>

        <td class='custom'>{$d['Phone']}</td>

        <td class='custom'>{$d['Mobile']}</td>

        <td class='custom'>{$d['Email']}</td>

        <td class='custom'>{$d['Web']}</td>

        <td class='custom'>{$d['State']}</td>

        <td class='custom'>{$d['Country']}</td>

        <td class='custom'>{$d['Profile']}</td>

      </tr>";

 

}

?>

 

  </table>

 

  </body>

  </html>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.