Advertisement
Guest User

Untitled

a guest
Dec 6th, 2016
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.12 KB | None | 0 0
  1.       <?php
  2.  
  3.                 error_reporting(E_ALL);
  4.                 ini_set('display_errors' , '1');
  5.                
  6.                 $studentssn = "0";
  7.                
  8.                 /*echo "sth"*/
  9.                 $db = new PDO("dblib:Server=localhost;Database=dec3h" , "SA" , "mssqlR00T");
  10.  
  11.  
  12.  
  13.                 $stmt = $db -> prepare("USE dec3h");
  14.                 $stmt->execute();
  15.  
  16.  
  17.  
  18.                 $stmt = $db -> prepare("GO");
  19.                 $stmt->execute();
  20.  
  21.  
  22.  
  23.                 $stmt = $db -> prepare("SELECT * FROM Clubs WHERE name IN (SELECT club_name FROM Clubs_Joined_By_Enrolled_Student WHERE enrolled_ssn = $studentssn"));
  24.                 $stmt->execute();
  25.  
  26.  
  27.  
  28.                 while($row = $stmt->fetch())
  29.                 {
  30.                   echo "<tr>";
  31.                   echo "<td>3</td>";
  32.                   $count = 0;
  33.                   while($count < 2)
  34.                   {
  35.                     echo "<td>";
  36.                     echo $row[$count];
  37.                     echo "</td>";
  38.                     $count = $count + 1;
  39.                   }
  40.                     echo "</tr>";
  41.                 }
  42.  
  43.               ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement