Hi All,
I was wondering whether someone could help, I would like to add microtime() to track how long it had taken to delete someone out of my simple database using PHP
as you can see below all my code can someone explain to me how we use microtime with delete? is it possible (even having the result output to a txt file would be handy too)
HTML
<table border=1 cellspacing="1" cellpadding="1">
<tr>
<th>
Name
</th>
<th>
Address
</th>
<th>
Firstname
</th>
<?php include ("core/includes/Deletescript.php"); ?>
</tr>
</table>
Deletescript.php
<?php
$mysql_host = "localhost";
$mysql_username = "root";
$mysql_password = "";
$mysql_database = 'test';
$bd = mysqli_connect($mysql_host, $mysql_username, $mysql_password, $mysql_database) or die ("Could not connect to mysql");
$sql = "SELECT * FROM helloworld";
$records = mysqli_query($bd,$sql);
while($row = mysqli_fetch_array($records))
{
echo "<tr>";
echo "<td>".$row['name']."</td>";
echo "<td>".$row['address']."</td>";
echo "<td>".$row['firstname']."</td>";
echo "<td><a href=index1.php?id=".$row['id'].">Delete</a></td>";
}
$sql = "DELETE FROM helloworld WHERE id='$_GET[id]'";
if(mysqli_query($bd, $sql))
header("refresh:1; url=index1.php");
else
echo "No
Current OUTPUT but I want to see the microtime be used once you delete a record out of the database
Name Address Firstname
bob London bob Delete
bob bob bob Delete