Advertisement
Guest User

Untitled

a guest
Mar 29th, 2018
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.39 KB | None | 0 0
  1. <hr /><h3>Event List v0.1 by djphil (CC-BY-NC-SA 4.0)</h3><hr />
  2. <?php
  3. /* Event List v0.1 by djphil (CC-BY-NC-SA 4.0) */
  4. ini_set('display_errors', 1);
  5. error_reporting(E_ALL);
  6.  
  7. $dbhost = "localhost";
  8. $dbuser = "root";
  9. $dbpass = "***";
  10. $dbname = "joomla";
  11. $tbname = "opensim_search_events";
  12.  
  13. $db = new mysqli($dbhost, $dbuser, $dbpass, $dbname);
  14. if ($db->connect_error) {die("Connection failed: " . $db->connect_error);}
  15.  
  16. $sql = "SELECT * FROM $tbname";
  17. $result = $db->query($sql);
  18.  
  19. if ($result->num_rows > 0)
  20. {
  21.     while($row = $result->fetch_assoc())
  22.     {
  23.         $name = $row['name'];
  24.         $description = $row['description'];
  25.         $category = $row['category'];
  26.         $dateutc = $row['dateUTC'];
  27.         $duration = $row["duration"];
  28.         $simname = $row['simname'];
  29.         $parcelname = $row['parcelName'];
  30.         $landingpoint = $row["landingpoint"];
  31.         $mature = $row['mature'];
  32.  
  33.         $txt = "name: ".$name
  34.                ." description: ".$description
  35.                ." category: ".$category
  36.                ." dateUTC: ".$dateutc
  37.                ." duration: ".$duration
  38.                ." simname: ".$simname
  39.                ." parcelname: ".$parcelname
  40.                ." landingpoint: ".$landingpoint        
  41.                ." mature: " .$mature;
  42.  
  43.         echo $txt."<br />";
  44.     }
  45. }
  46.  
  47. else {echo "0 results";}
  48. echo "<hr />";
  49. $db->close();
  50. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement