Created
August 24, 2010 11:39
-
-
Save slaskis/547408 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$sql = "SELECT word, COUNT(word) AS count FROM log WHERE true "; | |
if( isset($_GET["c"]) && $_GET["c"] != "" ) $sql .= " AND county = ". $_GET["c"]; | |
if( isset($_GET["g"]) && $_GET["g"] != "" ) $sql .= " AND gender = '". $_GET["g"] ."'"; | |
if( isset($_GET["b"]) && $_GET["b"] != "" ) $sql .= " AND age BETWEEN ". $_GET["b"] ." AND ". $_GET["t"]; | |
$sql .= " GROUP BY word ORDER BY count DESC LIMIT 10"; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment