SHARE
TWEET

Untitled

a guest Aug 12th, 2016 305 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //Split up the fields to the variables
  2. $username = $fields['username'];
  3. $ip = $fields['wpmem_reg_ip'];
  4. $mail = $fields['user_email'];
  5. $memberguidOut = '';
  6. $password = $fields['password'];
  7. $date = $fields['user_registered'];
  8. $classOut = '';
  9. $stateOut = '';
  10. $forestOut = '';
  11. $resultOut = '';
  12.  
  13. $servername = "someServerIP";
  14. $username = "someUsername";
  15. $password = "somePW";
  16. $myDB = "someDB";
  17.  
  18. //ini_set('mssql.min_error_severity',         11);
  19. //init_set('mssql.min_message_severity',        11);
  20.  
  21.  
  22. //connection to the database
  23. $conn = mssql_connect($servername, $username, $password)
  24. or die("Couldn't connect to SQL Server on $servername");
  25.  
  26. //select a database to work with
  27. $selectedDB = mssql_select_db($myDB, $conn)
  28. or die("Couldn't open database $myDB");
  29.  
  30. $proc = mssql_init('someSP', $selectedDB) or die(mssql_get_last_message());
  31.  
  32. mssql_bind($proc, "@member_id",        $username,        SQLVARCHAR,    FALSE, FALSE, 60);
  33. mssql_bind($proc, "@ip",               $ip,              SQLVARCHAR,    FALSE, FALSE, 60);
  34. mssql_bind($proc, "@mail",             $mail,            SQLVARCHAR,    FALSE, FALSE, 60);
  35. mssql_bind($proc, "@member_guid",      $memberguidOut,   SQLINT2,       TRUE);
  36. mssql_bind($proc, "@pwd",              $password,        SQLVARCHAR,    FALSE, FALSE, 60);
  37. mssql_bind($proc, "@input_date",       $date,            SQLVARCHAR,    FALSE, FALSE, 60);
  38. mssql_bind($proc, "@class",            $classOut,        SQLINT1,       TRUE);
  39. mssql_bind($proc, "@state",            $stateOut,        SQLINT1,       TRUE);
  40. mssql_bind($proc, "@forest",           $forestOut,       SQLINT1,       TRUE);
  41. mssql_bind($proc, "@result",           $resultOut,       SQLINT1,       TRUE);
  42.  
  43. $result = mssql_execute($proc) or die($wpmem_themsg = mssql_get_last_message());
  44. mssql_free_statement($proc) or die($wpmem_themsg = mssql_get_last_message());
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top