How do I get information from a stored procedure in MS SQL
I can run a query directly from the database.
Here is the code that I have being trying
I am getting the query failed error
Thanking in advance for any help received
I can run a query directly from the database.
Here is the code that I have being trying
Code:
$db = mssql_connect("server","user","password") or die("Unable to connect to server");
$db = mssql_select_db("database");
$query = mssql_init("ProcedureName",$db);
$result = mssql_execute($query) or die("QUERY FAILED");
print("<table border=1>");
print("<tr><th>Header 1</th><th>Header 2</th></tr>");
while ($row = mssql_fetch_object($result)) {
print("<tr>");
printf("<td>%s</td>", $row->FirstName);
printf("<td>%s</td>", $row->LastName);
print("</tr>");
}
print("</table>");
I am getting the query failed error
Thanking in advance for any help received