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>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.