Populate table with php in datagrid like fashion

Database-mysql

Table designing is necessary to view mysql tables in front of users to see what are the states of tabular data inside the tables.
Grid like styles have always been interesting as they are implemented in almost every web based application.
That’s why data is displayed by using Populate table with php in datagrid like fashion slogan

Advantages of tabular over other data representation

* It presents the data in a well organized passion for eye catching.

* User sees the data clearly and if there is something mistaken, he may call the I.T department

* Tabular data saves time and it is better than the graphs that often make the webpage too overloaded with the markup

* The tabulated data can be easily checked up.

Salient features of php

PHP will run on essentially any server, for free. That’s a fairly compelling feature for many folks.

PHP is one of the most agile development application environment for fast coders.

Greatest sites that use php are
Google
Apple
Facebook – that social networking site we cant get enough of
Yahoo!
Wikipedia
Digg
SitePoint
Amazon
Ebay
YouTube
Flickr

As you can see, most of the dominate players are playing with PHP – of course you’ll find that some use ASP.net, JAVA or ColdFusion but not up to that extent.Majority of free cms are built on php script/language.

<html>
<head>
<meta http-equiv=”Content-Type” content=”text/html; charset=UTF-8″>
<script src=”http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js” type=”text/javascript”></script>
<style type=”text/css”>
tr.header
{
font-weight:bold;
}
tr.alt
{
background-color: #777777;
}
</style>
<script type=”text/javascript”>
$(document).ready(function(){
$(‘.striped tr:even’).addClass(‘alt’);
});
</script>
<title></title>
</head>
<body>
<?php

$server = mysql_connect(“localhost”,”root”, “”);
$db = mysql_select_db(“MyDatabase”,$server);
$query = mysql_query(“select * from employees”);
?>
<table class=”striped”>
<tr class=”header”>
<td>Id</td>
<td>Name</td>
<td>Title</td>
</tr>
<?php
while ($row = mysql_fetch_array($query)) {
echo “<tr>”;
echo “<td>”.$row[ID].”</td>”;
echo “<td>”.$row[Name].”</td>”;
echo “<td>”.$row[Title].”</td>”;
echo “</tr>”;
}

?>
</table>
</body>
</html>

table1 table2

populating drop down grid and images credit goes to :http://stackoverflow.com

Syed Adeel Ahmed
Syed Adeel Ahmed
Analyst, Programmer, Educationist and Blogger at Technofranchise
Computer Systems Engineer from Sir Syed University Of Engineering & Technology.I am passionate about all types of programming.

Published by

Syed Adeel Ahmed

Computer Systems Engineer from Sir Syed University Of Engineering & Technology.I am passionate about all types of programming.

Leave a Reply