This new tutorial or post is about how the data show in the Gridview from database in PHP.
I am using the same database which i created in the previous post Or tutorial ((PHP Form Tutorial).
Database Name: clientinformation
Table Name: client_reg
I am using the same database which i created in the previous post Or tutorial ((PHP Form Tutorial).
Database Name: clientinformation
Table Name: client_reg
Here is the PHP code for displaying the data in the gridview or table form:
<table width="100%" border="1">
<tr>
<td><strong><font color="#000000">ID</font></strong></td>
<td><strong><font color="#000000">Client Name</font></strong></td>
<td><strong><font color="#000000">Address</font></strong></td>
<td><strong><font color="#000000">CNIC</font></strong></td>
<td><strong><font color="#000000">Mobile #</font></strong></td>
<td><strong><font color="#000000">Telephone #</font></strong></td>
<td><strong><font color="#000000">Company Name</font></strong></td>
<td><strong><font color="#000000">Client Status</font></strong></td>
<td><strong><font color="#000000">Register Date</font></strong></td>
<td><strong><font color="#000000">Edit/Delete/Complaints</font></strong></td>
</tr>
<?PHP
include("dbconnection.php");
$sql = "SELECT * FROM `client_reg` Order by Id DESC ";
//echo $sql;exit;
$result = mysql_query($sql);
while($row=mysql_fetch_array($result))
{
?>
<tr>
<td><?php echo $row['Id']; ?></td>
<td><?php echo $row['ClientName']; ?></td>
<td><?php echo $row['Address']; ?></td>
<td><?php echo $row['CNICNumber']; ?></td>
<td><?php echo $row['MobileNumber']; ?></td>
<td><?php echo $row['TelephoneNumber']; ?></td>
<td><?php echo $row['CompanyName']; ?></td>
<td><?php
if($row['ClientStatus']==1)
{
echo "Active";
}
else
{
echo "Inactive";
}
?></td>
<td><?php echo $row['RegisterDate']; ?></td>
<td><a href="Clientedit.php?cid=<?php echo $row['Id']; ?>"><strong>Edit</strong></a> | <a href="Clientdel.php?action=delete&id=<?php echo $row['Id']; ?>"><strong>Delete</strong></a> | <a href="Clientcomplaintlist.php?cid=<?php echo $row['Id']; ?>"><strong>Complaints</strong></a></td>
</tr>
<?php
}
?>
--------------------------------------------------------------
The Output of this PHP code is:
Data in Grid View |
it's not working. display did't view
ReplyDeleteHi, now i got the idea abt how to do that.
ReplyDeleteThank you.
If possible can u send me any sample project file on rdandnayak@gmail.com if u have any.
can you show code of Clientedit.php and Clientdel.php...!
ReplyDeleteI don't know do how to do that?
can u say if the grid is possible in jsp thanks in advance
ReplyDeleteGrid didn't show. wonder why..
ReplyDeleteHello sir can you send sample project file to me yoemnga@gmail.com ?
ReplyDeleteWorked 4r me.. tanQ
ReplyDeletegreat post thanks
ReplyDeleteHow to display in grid view only number of tabls.in php
ReplyDeleteNot auto genreted columns plizzz help me
here you display only table ... we need to display data in a gird view where 4 rows and 3 columns .. each th show single record ... explain this please
ReplyDeleteDelete, Edit and Complain file missing Please upload or send on my id pparesh13@gmail.com
ReplyDeleteThis comment has been removed by the author.
ReplyDeleteThis is very good information. Software Company in Dehradun
ReplyDeleteIt works. But I want to fetch image from database but it only retrieve name of file. here is my code:-
ReplyDeleteIt was really a nice post and i was really impressed by reading this
ReplyDeleteRuby on Rails Online Training Hyderabad
Warning: mysqli_query() expects at least 2 parameters, 1 given in C:\xampp1\htdocs\PROJECT\New\folder\home.php on line 15
ReplyDeleteWarning: mysqli_fetch_array() expects parameter 1 to be mysqli_result, null given in C:\xampp1\htdocs\PROJECT\New\folder\home.php on line 16
This comment has been removed by the author.
ReplyDeleteWarning: mysqli_query() expects at least 2 parameters, 1 given in C:\xampp1\htdocs\PROJECT\New\folder\home.php on line 15
ReplyDeleteWarning: mysqli_fetch_array() expects parameter 1 to be mysqli_result, null given in C:\xampp1\htdocs\PROJECT\New\folder\home.php on line 16
PLs reply fast