April 5, 2012
Show MySQL Table data in php by id eg index.php?id=24
Question by Daniel Moore
I want to show MYSQL Table data in php by id, so that when someone opens index.php?id=24
it will show all data in row 24.
Answer by Starx
You can get the value of id using
$id = (int)$_GET['id'];
Next, you can use this on your query
$query = "SELECT * FROM `yourtable` WHERE id='$id'";