Login using stored procedure with 2 in 4 out help

Hi,
I am rather rusty with my php coding and I am trying to create a login using a stored procedure with 2 in and 4 output variables. sp_LoginApplication. . with these ins and outs
IN:
p_userName VARCHAR
p_userPassword VARCHAR

OUT:
p_result INT
p_idIntitution INT
p_nameInstitution VARCHAR
p_userProfile INT

Here is the code I have

<?php

// Inialize session
session_start();

// Include database connection settings
include('config.inc');

// Retrieve username and password from database according to user's input
//$login = mysql_query("SELECT * FROM user WHERE (p_userName = '" . mysql_real_escape_string($_POST['username']) . "') and (p_userPassword = '" . mysql_real_escape_string(md5($_POST['password'])) . "')");
$login = mysql_query('CALL sp_loginApplication($_POST['username'], $_POST['password'], $loginResult, $idinstitution, $nameinstitution, $userprofile)');
// Check username and password match
if (mysql_num_rows($login) == 1) {
        // Set username session variable
        $_SESSION['username'] = $_POST['username'];
        // Jump to secured page
        header('Location: securedpage.php');
}
else {
        // Jump to login page
        header('Location: index.php');
}

?>

I keep getting a Parse error: syntax error, unexpected T_STRING in /homepages/37/d89354651/htdocs/tek/test/Portal/examples/loginproc.php on line 11

Any help would be great. . .
Thanks

I don’t have experience with Stored Procedures.
But, the Syntax Error can be squelched with this change:


$login = mysql_query('CALL sp_loginApplication(' . $_POST['username'] . ',' . $_POST['password'] . ',' . $loginResult . ',' . $idinstitution . ',' . $nameinstitution . ',' . $userprofile . ')');


thanks that cleared that one, and now I have other issues.
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /homepages/37/d89354651/htdocs/tek/test/Portal/examples/loginproc.php on line 13

Warning: Cannot modify header information - headers already sent by (output started at /homepages/37/d89354651/htdocs/tek/test/Portal/examples/loginproc.php:13) in /homepages/37/d89354651/htdocs/tek/test/Portal/examples/loginproc.php on line 21