Firstly, you are making things difficult for yourself, or at elast more complicated than need be.
$_SESSION[] is a SUPER GLOBAL that means it does not need to be called into a function like you are doing. It will always be avalible to that function whether you like it or not.
i.e:
function addDivName($_SESSION['newleague_id'],$_SESSION['sport_id'].'))
//Also, where is that ." at the end coming from? parse error!
//you can leave it as
function addDivName()
Your parse errors are coming because within the super globals in your $query you have quotes ('). it thinks you have ended that particular part of the statement and gets all fussy. Dont worry I ran into that when I first started out too 🙂. You are also not keeping the valuesyou are entering in quotes either.
The answer is simple and there are 2! (That I know of at least!):
//use this query:
//Notice the ".." system
$query = "INSERT INTO divisons (league_id, sport_id) VALUES ('".$_SESSION['newleague_id']."', '".$_SESSION['sport_id']."')";
//Or this one
//Anotice the use of {} around the variable
$query = "INSERT INTO divisons (league_id, sport_id) VALUES ('{$_SESSION['newleague_id']}', '{$_SESSION['sport_id']}')";
There was also a comma appearing before the leugue in the query aswell, that shouldnt be there.
Try those and see if they work. =]