I have a simple my-sql table:
+----+----------+----------+-------------+-----------+
| id | Name | Father | National | Value |
+----+----------+----------+-------------+-----------+
| 1 | Daniel | David | American | 0 |
| 2 | Rebbeka | Craig | American | 0 |
| 3 | Robert | John | American | 0 |
| 4 | Arjun | Daneil | Indian | 0 |
| 5 | Ana | Peter | British | 0 |
+----+----------+----------+-------------+-----------+
I need to a php-script to query and fetch new single row every time it is executed. It may be based on ID.
About code/framework, i am using simple php5 with mysql on ubuntu server.
This is my code, the probelem is that it outputs whole of the Name,Father columns every time on call, i just want to print a single row everytime it is executed. and on every php script execution a new row should be printed based on id in ascending order.
<?php
$con = mysqli_connect('localhost','user','pass','database');
$result = mysqli_query($con,"select * from table");
while($row = mysqli_fetch_array($result)) {
echo "Name:" . $row['name'] . " " . "Father's Name:" . $row['father'];
echo "<br>";
}
mysqli_close($con);
?>
Every help is much appreciated.