Jump to content

Recommended Posts

Dear sir

 

I am stuck in one problem, I want to display data in the tables using PHP, data will be accessed from MySQL. It should have a delete function, edit function and view function.

 

An example of what I need is attached.

 

Can please somebody make an easy code for it and paste it. I will appreciate your help.

 

Regards

 

Shawn

 

[attachment deleted by admin]

Link to comment
https://forums.phpfreaks.com/topic/48985-arrange-data-in-tables-using-php/
Share on other sites

http://www.google.com/search?hl=en&q=php+mysql+datagrid

 

You are basically asking for someone to create all of your code for you, not going to happen. If you want that goto the freelance form. If not I suggest looking into a PHP Datagrid. The code is already done.

Can please somebody make an easy code for it and paste it.

 

PHP Help is found on the PHP HELP forum!!!

For complete custom written scripts you should go to the freelance forum like "frost110" suggested (AND AS THE FORUM RULES STATE)

for complete script you could also search http://www.hotscripts.com

 

 

nice day, dear sir

At it's most basic,

<?php
include 'db.php';    //connnection stuff

function table2Table($tname) {
    $result = mysql_query("SELECT * FROM `$tname` ");

    $str = "<TABLE border='1' cellpadding='4'>\n";

    // column headings
          $str .=  "<tr>\n";
          while ($fld = mysql_fetch_field ($result)) {
                   $str .= "<th>{$fld->name}</th>\n";
          }
          $str .=  "</tr>\n";
      

    // list data
          while ($row = mysql_fetch_row($result)) {
          $str .=  "<tr>\n";
          foreach ($row as $field) {
                   $str .=  "<td>$field</td>\n";
          }
          $str .=  "</tr>\n";
    }

    $str .=  "</TABLE>\n";
    
    return $str;
}

// call function
echo table2Table('mytablename');
?>

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.