include "../db.php4"; if (!isset($ord)) { $ord = 'title'; } if (isset($show)) { $rs = @mysql_query("SELECT *, UNIX_TIMESTAMP(drink) as drinkdate FROM wine WHERE drink < NOW() AND drunk = 0 ORDER BY $ord ASC;"); } else if (isset($keyword)) { $rs = @mysql_query("SELECT *, UNIX_TIMESTAMP(drink) as drinkdate FROM wine WHERE title LIKE '%$keyword%' AND drunk = 0 ORDER BY $ord ASC;"); } else if (isset($old)) { $rs = @mysql_query("SELECT *, UNIX_TIMESTAMP(drink) as drinkdate FROM wine WHERE drunk = 1 ORDER BY $ord ASC;"); } else { $rs = @mysql_query("SELECT *, UNIX_TIMESTAMP(drink) as drinkdate, UNIX_TIMESTAMP(drunkdate) as drunkdate FROM wine WHERE drunk = 1 ORDER BY $ord ASC;"); } ?>
wine index
add new wine
wine description | Grape | Region | Winery | Year | Score | Drunk Date | Drink Date | Location | |
... | 0 | 1 January 1970 | January 1970 | , Row , Column | delete |
@mysql_close($dbcnx); ?>