SHARE
TWEET

Untitled

a guest Aug 17th, 2018 89 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2. $title = $_POST['title'];
  3. $host = "localhost";
  4.         $user = "root";
  5.         $pass = "";
  6.         $db = "c203";
  7.  
  8.         // open connection
  9.         $link = mysqli_connect($host, $user, $pass, $db);
  10.  
  11.         // build SQL statement
  12.         $query = "SELECT * FROM music";
  13.  
  14.         // execute SQL statement
  15.         $result = mysqli_query($link, $query) or die(mysqli_error($link));
  16.         mysqli_close($link);
  17.         $row=mysqli_fetch_array($result);
  18.  
  19.         if ($title == $row[0]):
  20.             echo "Title: ".$row[0]."<br>";
  21.             echo "Music Album: ".$row[1]."<br>";
  22.             echo "Artist: ".$row[2]."<br>";
  23.             echo "Rating: ".$row[3]."<br>";
  24.             echo "Review: ".$row[4]."<br>";
  25.         else:
  26.             echo "Song not in data";
  27. ?>
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