- Joined
- Mar 6, 2014
- Messages
- 140
- Points
- 0
Looking for the logic from you guys...
I did this for table view. Now I want that when I click on edit option than that particular record is open and I edit that and after that fire the update query to save the data into database. I did this through id easily but I didn't maintain it for this table this is why I'm worried. Can you guys help me in this.. I am learning php by profession I'm se optimizer. Looking forward for your help..if(isset($_POST['submit']))
{
$ssql = mysqli_query($con, "SELECT * FROM `register`");
// $nrows= mysqli_num_rows($ssql);
echo "<table border=5 table style=margin-top: 252px; font-size: larger; font-style: oblique; bgcolor=#05fa8c>
<tr>
<td width=10% height= 10%><b>User Name:</b></td>
<td width=10% height= 10%><b>First Name:</b></td>
<td width=10% height= 10%><b>Last Name:</b></td>
<td width=10% height= 10%><b>Password:</b></td>
<td width=10% height= 10%><b>Email:</b></td>
<td width=10% height= 10%><b>Role Type:</b></td>
<td width=10% height= 10%><b>About:</b></td>
<td width=10% height= 10%><b>Edit<b></td>
<td width=10% height= 10%><b>Delete</b></td>
</tr>";
while($row = mysqli_fetch_array($ssql)){
$uname = $row['username'];
$fname = $row['firstname'];
$lname = $row['lastname'];
$pwd = $row['password'];
$emal = $row['email'];
$rol = $row['role'];
$abt = $row['profession'];
echo "<tr>
<td width=10% height= 10%>$uname</td>
<td width=10% height= 10%>$fname</td>
<td width=10% height= 10%>$lname</td>
<td width=10% height= 10%>$pwd</td>
<td width=10% height= 10%>$emal</td>
<td width=10% height= 10%>$rol</td>
<td width=10% height= 10%>$abt</td>
<td width=10% height= 10%><a href=edit_records.html>Edit</a></td>
<td width=10% height= 10%><a href=edit_records.html>Delete</a></td>
</tr>";
}
echo "</table>";