Advertisement
SouldrinK

Untitled

Oct 29th, 2012
48
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.50 KB | None | 0 0
  1. <?php
  2. include("config.php");
  3.  
  4. $query = "SELECT tours.Id, tours.Name FROM tours JOIN dates ON tours.Id = dates.TourId AND dates.StartDate > '2012-12-31' WHERE Hide = '1' ORDER BY tours.Id";
  5. $result = mysql_query($query);
  6.  
  7. $oldid = 0;
  8.  
  9. while ($row = mysql_fetch_array($result)) {
  10.     if ($row['Id'] != $oldid) {
  11.         echo $row['Id'] . "<br>\n";
  12.         unhide($row['Id']);
  13.         $oldid = $row['Id'];
  14.     }
  15. }
  16.  
  17. function unhide($id) {
  18.     mysql_query("UPDATE tours SET Hide='0' WHERE Id = '" . $id . "' LIMIT 1");
  19. }
  20. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement