So I assume you know how to connect to the mysql DB and create a query to select records?
If so, then once you get your records with something like below (I am using the PDO class for the connection to the DB). This code will
// this code assumes you are properly connected to the mysql DB and the connection
// is called "$DBcon" and you have a DB table named "tennis_stats_tbl" in your DB.
$query = "SELECT * FROM tennis_stats_tbl";
// would need to add a WHERE clause to filter out data gender and rank received
// from the request/post)
$stmt = $DBcon->prepare($query);
$tennisStats= array(); // initialize an array to inserts query results
// now loop through each row of data and insert into $tennisStats array
$tennisStats['TennisStats'] = $row;
$jsonData = json_encode($tennisStats);
// the above assign a JSON string of the data which can be returned to the client
// requesting this page