should just be
$sql = "SELECT [rows_to_select] FROM ticket_table WHERE ticket_id = $ticket";
$result = mysql_query($sql, $connection);
$row = mysql_fetch_array($result);
I think on some newer versions of PHP you might have to declare $ticket=$_GET["ticket"]; or something along those lines, but I'm not sure.