I've build a php page called pageById.php that pulls in and displays data from a MySQL database, but the query is 'static'.
$sql = "SELECT * FROM table WHERE id = 879";
I want to change this so it uses a variable in-place of 879.
$sql = "SELECT * FROM table WHERE id = $var";
I'd like to be able to pull the $var from a link on the previous page or from the URL, but I'm not sure how.
Can someone please help or point me in the direction of a decent tutorial for beginners?
Thanks!