We're a community of 1076K IT Pros here for help, advice, solutions, professional growth and fun. Join us!
1,075,894 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Start New Discussion Reply to this Discussion

Php data control

Hi

I am new to PHP and need a help regarding data controls in PHP.

Like grid view?

Thanks

2
Contributors
5
Replies
12 Hours
Discussion Span
1 Year Ago
Last Updated
6
Views
adityamadhira
Newbie Poster
23 posts since Feb 2012
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0

Please explain what you want. Something like this or this perhaps?

pritaeas
Posting Prodigy
Moderator
9,267 posts since Jul 2006
Reputation Points: 1,173
Solved Threads: 1,456
Skill Endorsements: 86

Please explain what you want. Something like this or this perhaps?

I need a data grid that must display the required fields along with delete button in one column.....and also required paging for the grid.


I hope you got it.

adityamadhira
Newbie Poster
23 posts since Feb 2012
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0

Already posted an almost ready solution. Try it.

pritaeas
Posting Prodigy
Moderator
9,267 posts since Jul 2006
Reputation Points: 1,173
Solved Threads: 1,456
Skill Endorsements: 86

Already posted an almost ready solution. Try it.

this is my code

<?php
require_once 'Database.php';
$connect =new DB;
$connect ->connect();
// *** Turn on error reporting for debug purposes.
// *** Remove for production code.
error_reporting(E_ALL);
ini_set("display_errors", 1);

// *** Get list of users from the db.
$sql = "SELECT * FROM usersinfo";
$result = mysql_query($sql);

if (!$result) {

exit("QUERY ERROR: " . mysql_error());

} else {

// *** Display the user list.
$tableRow = '';

while($row = mysql_fetch_assoc($result)) {

$user_id = $row;
$user_name = $row;
$tableRow .= "<tr> <td>$user_id</td> <td>$user_name</td> <td> <a href=\"delete_user.php?id=$user_id\"> Delete </a> </td> </tr>";

}

$tableHeader = "<tr> <th>USER ID</th> <th>USER NAME</th> <th>ACTION</th> </tr>";

echo("<table>$tableHeader $tableRow </table>");
}

mysql_close($conn);

?>

How to do paging for this code?

adityamadhira
Newbie Poster
23 posts since Feb 2012
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0

Choose one solution and read the manual.

pritaeas
Posting Prodigy
Moderator
9,267 posts since Jul 2006
Reputation Points: 1,173
Solved Threads: 1,456
Skill Endorsements: 86

This article has been dead for over three months: Start a new discussion instead

Post: Markdown Syntax: Formatting Help
 
You
View similar articles that have also been tagged:
 
© 2013 DaniWeb® LLC
Page rendered in 0.0687 seconds using 2.65MB