SHARE
TWEET

Untitled

a guest Sep 3rd, 2018 98 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. How do I use Objective-c to connect to my php/MySQL server?
  2. <?
  3.  
  4. $name = $_GET['name'];
  5. $minScore = $_GET['minScore'];
  6. $hourScore = $_GET['hourScore'];
  7. $dayScore = $_GET['dayScore'];
  8.  
  9. $service = "dddd.com";
  10. $username = "dddd";
  11. $password = "dddd";
  12. $database = "dddd_DATA1";
  13.  
  14. mysql_connect($service, $username, $password);
  15. @mysql_select_db($database) or die( "Unable to select database");
  16.  
  17. if($minScore>0) {
  18.     $query="INSERT INTO currentScores VALUES ('$name', '$minScore', '$hourScore','$dayScore',null)";
  19.     $result=mysql_query($query);
  20.     echo("Score submitted! Name: $name, Score: $minScore");
  21. }
  22. else {
  23. echo("No score was submitted");
  24. }
  25.  
  26. ?>
  27.    
  28. NSError * error = nil;
  29. NSURLResponse * response = nil;
  30. NSData * downloadedData = [NSURLConnection sendSynchronousRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:@""]]
  31.                                                 returningResponse:&response
  32.                                                             error:&error];
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