ulvis.paste.net - pastebin

Paste Search Dynamic
Recent pastes
result
  1. <?php
  2. $result = mysql_query("SELECT id,email FROM people WHERE id = '42'");
  3. if (!$result) {
  4.     echo 'Could not run query: ' . mysql_error();
  5.     exit;
  6. }
  7. /* Use the result, assuming we're done with it afterwards */
  8. $row = mysql_fetch_assoc($result);
  9.  
  10. /* Now we free up the result and continue on with our script */
  11.  
  12. echo $row['id'];
  13. echo $row['email'];
  14. ?>
  15.  
  16. <?php
  17.  
  18. $db_link = @mysql_connect('localhost', 'mysql_user', 'mysql_pass');
  19. if (!$db_link) {
  20.    die('Can\'t connect : ' . mysql_error());
  21. }
  22.  
  23. ?>
  24.  
  25. Or even:
  26. <?php
  27.   $db_link = @mysql_connect('localhost', 'mysql_user', 'mysql_pass')
  28.   or die('Can\'t connect : ' . mysql_error());
  29. }
  30. ?>
  31.  
  32. <?php
  33. // prints: mysql link
  34.  
  35. // prints: file
  36. $fp = fopen("foo", "w");
  37. echo get_resource_type($fp) . "\n";
  38.  
  39. // prints: domxml document
  40. $doc = new_xmldoc("1.0");
  41. echo get_resource_type($doc->doc) . "\n";
  42. ?>
  43.  
  44. <?
  45. // prints: the true
  46. $s = "The Future is Tricolor (PAN)";
  47. echo $s;
  48. ?>
Parsed in 0.035 seconds