I've sorted it - well, it works.
Code I've used for displaying and linking to new page with info:
PHP Code:
<?php
$con = mysql_connect("*****","*****","*****");
if (!$con)
{
die('Could not connect to database');
}
mysql_select_db("*****", $con);
$keywords = $_POST['key_words'];
$sql = "SELECT Player_id, Surname, First_Name
FROM Squad_List
WHERE Surname LIKE '%$keywords%'
OR First_Name LIKE '%$keywords%'
ORDER BY Surname";
$rst = mysql_query($sql, $con);
while($a_row = mysql_fetch_assoc($rst)) {
print ("<a href='player.php?id={$a_row['Player_id']}'>{$a_row['First_Name']} {$a_row['Surname']}</a><br>" );
}
mysql_close($con); //close the connection to the database
?>
Code I've used on the new page:
PHP Code:
<?php
$con = mysql_connect("*****","*****","*****");
if (!$con)
{
die('Could not connect to database');
}
mysql_select_db("*****", $con);
$id = $_GET['id'];
$sql = "SELECT * FROM Squad_List WHERE Player_id = {$id}";
$rst = mysql_query($sql, $con);
$a_row = mysql_fetch_assoc($rst);
print ("{$a_row['First_Name']} {$a_row['Surname']}</a><br>" );
print ("{$a_row['Position']}<br>" );
print ("{$a_row['Age']}<br>" );
?>