Advertisement
Guest User

Untitled

a guest
Dec 3rd, 2016
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.33 KB | None | 0 0
  1. -----------------------------------------
  2. Favorites Username and Password removed****
  3. -----------------------------------------
  4. #!/usr/local/bin/php
  5. <?php
  6. $connection = oci_connect($username = '*******',
  7. $password = '********',
  8. $connection_string = '//oracle.cise.ufl.edu/orcl');
  9.  
  10.  
  11. $loginpls = oci_parse($connection, "SELECT * FROM currentUser");
  12. oci_execute($loginpls);
  13. $row = oci_fetch_array($loginpls);
  14. $uname = $row[0];
  15. echo$uname;
  16. oci_free_statement($loginpls);
  17.  
  18. //logged in username references his favorited VINS
  19. $selectFavoriteVins = oci_parse($connection, "SELECT favvin FROM Favorites WHERE favusername = '$uname'");
  20. $favVins = oci_execute($selectFavoriteVins);
  21. while ($row = oci_fetch_array($selectFavoriteVins, OCI_ASSOC+OCI_RETURN_NULLS)){
  22. foreach($row as $item)
  23. {
  24. //for the length of the number of FavVins, the car with that VIN is returned
  25. $selectVehicles = oci_parse($connection, "SELECT * FROM vehicle WHERE vin = '$item'");
  26. $Svehicles = oci_execute($selectVehicles);
  27. print "<table border='1'>\n";
  28. while ($row2 = oci_fetch_array($selectVehicles, OCI_ASSOC+OCI_RETURN_NULLS))
  29. {
  30. print "<tr>\n";
  31. foreach ($row2 as $item2)
  32. {
  33. print " <td>" . ($item2 !== null ? htmlentities($item2, ENT_QUOTES) : " ") . "</td>\n";
  34. }
  35. print "</tr>\n";
  36. }
  37.  
  38. }
  39. }
  40.  
  41.  
  42. oci_close($connection);
  43. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement