I'm trying to learn how to most efficiently access MS SQL databases. I have a stored procedure that I can call using the format:
Code:
$Result = mssql_query("sp_MyProc varA varB");
This seems to work OK but I wonder if it would be more efficient to use
Code:
$stmt = mssql_init('myProc');
mssql_bind($stmt, '@varA', $varA, SQLINT4, 0);
mssql_bind($stmt, '@varB', $varB, SQLINT4, 0);
$Result = mssql_execute($stmt);
Is this second method any more efficient for executing queries that get executed a lot? If not, what advantage does it offer? I really don't understand this second method, especially the fourth parameter (SQINT4).