I have created a Function which will find the assistant coach for a team within the database. (i have checked the query within phpmyadmin and it works).
function assistantCoach() {
$query_assistcoach = "SELECT * FROM coach, team WHERE team.team_id = '1' and coach.team_id = '1' AND coach.team_role = 'Assistant' ";
$assistcoach = mysql_query($conn, $query_assistcoach);
}
I would like to output the coaches fname and sname on Team Page the coach is linked with.
I have tried using $assistcoach = assistantCoach();
at the top of the page and then within the page using <?php echo ($assistcoach['fname']) ?>
The above is throwing a
Fatal error: Uncaught Error: Call to undefined function mysql_query() in \inc\functions.php:25 Stack trace: #0 \teampage.php(9): assistantCoach() #1 {main} thrown in \inc\functions.php on line 25
Line 25 is $assistcoach = mysql_query($conn, $query_assistcoach);
part of the function.