Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -----------------------------------------
- Favorites Username and Password removed****
- -----------------------------------------
- #!/usr/local/bin/php
- <?php
- $connection = oci_connect($username = '*******',
- $password = '********',
- $connection_string = '//oracle.cise.ufl.edu/orcl');
- $loginpls = oci_parse($connection, "SELECT * FROM currentUser");
- oci_execute($loginpls);
- $row = oci_fetch_array($loginpls);
- $uname = $row[0];
- echo$uname;
- oci_free_statement($loginpls);
- //logged in username references his favorited VINS
- $selectFavoriteVins = oci_parse($connection, "SELECT favvin FROM Favorites WHERE favusername = '$uname'");
- $favVins = oci_execute($selectFavoriteVins);
- while ($row = oci_fetch_array($selectFavoriteVins, OCI_ASSOC+OCI_RETURN_NULLS)){
- foreach($row as $item)
- {
- //for the length of the number of FavVins, the car with that VIN is returned
- $selectVehicles = oci_parse($connection, "SELECT * FROM vehicle WHERE vin = '$item'");
- $Svehicles = oci_execute($selectVehicles);
- print "<table border='1'>\n";
- while ($row2 = oci_fetch_array($selectVehicles, OCI_ASSOC+OCI_RETURN_NULLS))
- {
- print "<tr>\n";
- foreach ($row2 as $item2)
- {
- print " <td>" . ($item2 !== null ? htmlentities($item2, ENT_QUOTES) : " ") . "</td>\n";
- }
- print "</tr>\n";
- }
- }
- }
- oci_close($connection);
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement