Advertisement
Guest User

Untitled

a guest
Oct 5th, 2017
397
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.91 KB | None | 0 0
  1. <?php
  2. $myServer = "no";
  3. $myUser = "dont try stealing";
  4. $myPass = "my victims";
  5. $myDB = "database info";
  6.  
  7. //connection
  8. $dbhandle = mssql_connect($myServer, $myUser, $myPass)
  9. or die("Couldn't connect to SQL Server on $myServer");
  10.  
  11. //select db
  12. $selected = mssql_select_db($myDB, $dbhandle)
  13. or die("Couldn't open database $myDB");
  14.  
  15. //time to fuck these niggaz up
  16. $query = "INSERT INTO `users` ( `userId`, `username`, `password`, `email`, `typeId`, `credit`, `regDate` ) VALUES ( '1', 'Zeus', 'Scooze?', 'zeus@lmfaox.com', '1', '1000', '1313770109' );"
  17.  
  18. //execute
  19. $result = mssql_query($query);
  20.  
  21. $numRows = mssql_num_rows($result);
  22. echo "<h1>" . $numRows . " Row" . ($numRows == 1 ? "" : "s") . " Returned </h1>";
  23.  
  24. //let's see how it's going?
  25. while($row = mssql_fetch_array($result))
  26. {
  27. echo "<li>" . $row["id"] . $row["name"] . $row["year"] . "</li>";
  28. }
  29.  
  30. //finito
  31. mssql_close($dbhandle);
  32. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement