Guest User

Untitled

a guest
Jun 19th, 2018
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 3.10 KB | None | 0 0
  1. <?php
  2.  
  3. $uid = $_SESSION['id'];
  4.  
  5.  
  6. #First I assign the query to an object.
  7. $sql = "SELECT email from users where id='$uid'";
  8.  
  9. #i assign the result of the query to an object, which in turn runs the query
  10. $result=mysql_query($sql);    
  11.  
  12. #checking my sql just for this and giggles.
  13. #echo $sql;
  14. #echo "<br />";
  15. #assigns the resulting array to an object..doesnt have to be query_row..it could be called anything..
  16. $query_row=mysql_fetch_array($result);
  17.  
  18. #echos out the result of the array, more specifically the result within the coloumn email
  19. #echo $query_row[email];
  20.  
  21. #again im assigning the query to an object
  22. $sql = "SELECT bid from manifest where uid='$uid'";
  23. #result of the query to an object again, which in turn runs the query
  24. $result=mysql_query($sql);
  25. #setting of the array to an object
  26. $query_row=mysql_fetch_array($result);
  27. #just echoing the secondary query
  28. #echo $sql;
  29. #and pulling the info.
  30. #echo $query_row[bid];    
  31.  
  32.  
  33.  
  34. $bid = $query_row[bid];
  35.  
  36. # $pullbooking = "SELECT * from bookings where id='$bid'" ;
  37. #$sqlbig = "SELECT bookings.title, bookings.date, bookings.start_time, bookings.end_time, bookings.venue, bookings.city, bookings.state, bookings.country, bookings.created_at, bookings.updated_at, bookings.creator_id, bookings.cover, bookings.age_limit, bookings.description
  38. #           FROM bookings
  39. #           INNER JOIN manifest ON bookings.id = manifest.bid
  40. #           WHERE manifest.uid ='$uid'";
  41.  
  42. $sqlbig = "SELECT bookings.title, bookings.date, bookings.start_time, bookings.end_time, bookings.venue, bookings.city, bookings.state, bookings.country, bookings.created_at, bookings.updated_at, bookings.creator_id, bookings.cover, bookings.age_limit, bookings.description
  43.           FROM bookings
  44.           INNER JOIN manifest ON bookings.id = manifest.bid
  45.           WHERE manifest.uid ='$uid'";
  46.                
  47.  
  48. $bookingresult = mysql_query($sqlbig);
  49. $bookingarray=mysql_fetch_array($bookingresult);
  50.  
  51. echo "<br><br><br>";
  52.  
  53. $bookingresult  = mysql_query($sqlbig);
  54. $row = mysql_fetch_assoc($bookingresult);
  55. do{
  56.     echo $row["title"];
  57.     echo "<br />";
  58.     echo $row["venue"];
  59.     echo "<br />"
  60.     }
  61. while ($row = mysql_fetch_assoc($bookingresult));
  62.  
  63.  
  64. $bookingresult  = mysql_query($sqlbig) or die(mysql_error());
  65. if (mysql_num_rows($bookingresult) > 0) {
  66.     ?><table cellspacing="0" cellpadding="2">
  67.     <thead>
  68.         <tr>
  69.             <th>Title</th>
  70.             <th>Date</th>
  71.             <th>Start Time</th>
  72.             <th>End Time</th>
  73.             <th>Venue</th>
  74.             <th>City</th>
  75.             <th>State</th>
  76.             <th>Country</th>
  77.             <th>Cover</th>
  78.             <th>Age Limit</th>
  79.             <th>Description</th>
  80.         </tr>
  81.     </thead>
  82.     <tbody><?
  83.     while ($row = mysql_fetch_assoc($bookingresult)) {
  84.         ?><tr>
  85.             <td><?= $row["title"] ?></td>
  86.             <td><?= $row["date"] ?></td>
  87.             <td><?= $row["start_time"] ?></td>
  88.             <td><?= $row["end_time"] ?></td>
  89.             <td><?= $row["venue"] ?></td>
  90.             <td><?= $row["city"] ?></td>
  91.             <td><?= $row["state"] ?></td>
  92.             <td><?= $row["country"] ?></td>
  93.             <td><?= $row["cover"] ?></td>
  94.             <td><?= $row["age_limit"] ?></td>
  95.             <td><?= $row["description"] ?></td>
  96.         </tr>
  97.     <?
  98.     }
  99. }
  100. else {
  101.     echo "aint shit here nigga";
  102. }
  103. ?>
Add Comment
Please, Sign In to add comment