(That's it. I don't know how to add edit button under "edit column" of each row.) Please suggest me any solution for this problem.
enter link description here
http://localhost/test/logindetails.php?edit=Modify#enter code here
<?php
// making connection
$conn=mysqli_connect('localhost','root','') ;
// selecting database
mysqli_select_db($conn,"company") ;
$sql= "SELECT * FROM login" ;
$records=mysqli_query($conn,$sql) ;
?>
<html>
<head>
</script>
<title>Details!!!!</title>
</head>
<body>
♠
<h2>Details!!!!!!!!!</h2>
<div>
<table width="600" border="1" cellpadding="1" cellspacing="1">
<tr>
<th>Id</th>
<th>Username</th>
<th>Password</th>
<th>Edit</th>
</tr>
</div>
<?php
while($std = mysqli_fetch_array($records))
{
echo "<tr>";
echo "<td>" . $std['id'] . "</td>";
echo "<td>" . $std['username'] . "</td>";
echo "<td>" . $std['password'] . "</td>";
echo "<td>" . $std['Edit'] . "</td>";
echo "</tr>";
}
?>
</table>
</body>
</html>
If there is no database connection then use :
<table>
<tbody>
<?php for($i=0;$i<11;$i++){?>
<tr><td><input type="submit" value="submit"/></td></tr>
<?php } ?>
</table>
It will print a table with 10 rows and all the td contains a button.
$str = "select * from mytable";
$sql = mysqli_query($str );
<table>
<?php while($data = mysqli_fetch_array($sql)){ ?>
<tr>
<td><? echo $data; ?></td>
<td><button>or anything to edit</button></td>
</tr>
<?php } ?>
</table>
it will print as much as data did u have in database.
Just you want create mnew page details.php redirect using edit link then update records
while($std = mysqli_fetch_array($records))
{
echo "<tr>";
echo "<td>" . $std['id'] . "</td>";
echo "<td>" . $std['username'] . "</td>";
echo "<td>" . $std['password'] . "</td>";
echo "<td><a href='details.php?id=".$std['id']."'>Edit</a></td>";
echo "</tr>";
}