Tuesday, 2 July 2013

Coding for viewing the values by fetching from the database

Here is the coding for viewing the values in your designing page by fetching the values from the database.

<table border="1px" cellpadding="10" cellspacing="0" width="50">
     <th scope="col">S.No</th>
     <th scope="col">Image</th>
     <th scope="col">Edit</th>
     <th scope="col">Delete</th>
//include the connection code here
$select=mysql_query("select * from tablename"); 
    echo "<td>".$x++."</td>";
    echo "<td><img src='foldername/".$row['name']."' width='50px' height='50px' alt=".$row['name']."</td>";
    echo "<td><a href='edit.php?edit=".$row['id']."'>Edit</a></td>";
    echo "<td><a href='delete.php?delete=".$row['id']."'>Delete</a></td>";
    echo "</tr>";