Advertisement
Guest User

Untitled

a guest
May 11th, 2016
192
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.28 KB | None | 0 0
  1. $username = 'my@email.com';
  2. $password = 'test';
  3. $stmt = $odbc->prepare("CALL dbo.uspGetLoginUserInformation(:username, :password)");
  4. $stmt->bindParam(':username', $username);
  5. $stmt->bindParam(':password', $password);
  6. $stmt->execute();
  7.  
  8. $stmt = $odbc->prepare("Exec uspGetLoginUserInformation @Username=:username, @Password=:password");
  9.  
  10. $params = array(array($date, SQLSRV_PARAM_IN),array($location, SQLSRV_PARAM_IN),array(3, SQLSRV_PARAM_IN));
  11. $result = sqlsrv_query($sqldb, "{call Some_Stored_Procedure ( @base_date=?,@location=?,@plusdays=? )}", $params);
  12.  
  13. $q = "{call Some_Stored_Procedure ( @base_date=?,@location=?,@plusdays=? )}";
  14. $params = array(array($date, SQLSRV_PARAM_IN),array($location, SQLSRV_PARAM_IN),array(3, SQLSRV_PARAM_IN));
  15. $stmt = $CONN->prepare($q);
  16. $stmt->execute($params);
  17.  
  18. $q = "{call Database.dbo.Some_Stored_Procedure ( @base_date=?,@location=?,@plusdays=? )}";
  19. $params = array(array($date, SQLSRV_PARAM_IN),array($location, SQLSRV_PARAM_IN),array(3, SQLSRV_PARAM_IN));
  20. $stmt = $CONN->prepare($q);
  21. $stmt->execute($params);
  22.  
  23. $stmt = $CONN->prepare("Exec Database.dbo.Some_Stored_Procedure ?, ?, 3");
  24. $stmt->execute(array($date, $location));
  25.  
  26. CALL Some_Stored_Procedure(Param1, Param2, ...);
  27.  
  28. EXEC Some_Stored_Procedure Param1, Param2, ...;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement