diff options
| author | Horus3 | 2014-02-26 19:48:59 +0100 |
|---|---|---|
| committer | Horus3 | 2014-02-26 19:48:59 +0100 |
| commit | 71da2f74b621c838f835fd04d6f2d737bfceb6b0 (patch) | |
| tree | e9361dbd2fcdd33cedff84c73add9c6cf892373d /www/youtube_functions.php | |
| parent | f4c30ebad16c0b72aaf122dab4fb193c780e2ac9 (diff) | |
| download | random-71da2f74b621c838f835fd04d6f2d737bfceb6b0.tar.gz | |
merged into one file
Diffstat (limited to 'www/youtube_functions.php')
| -rw-r--r-- | www/youtube_functions.php | 40 |
1 files changed, 0 insertions, 40 deletions
diff --git a/www/youtube_functions.php b/www/youtube_functions.php deleted file mode 100644 index 17a8964..0000000 --- a/www/youtube_functions.php +++ /dev/null @@ -1,40 +0,0 @@ -<? - -function get_video(){ - - $youtube_array = array("a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", - "r", "s", "t", "u", "v", "w", "x", "y", "z", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", - "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "_", "-", "0", "1", "2", "3", "4", - "5", "6", "7", "8", "9" ); - - $length = count($youtube_array); - - $string = ""; - - for ($i=0;$i<4;$i++){ - $index = mt_rand(0,$length-1); - $string = "$string".$youtube_array[$index]; - } - return $string; -} - -function searchterm(){ - $db = new SQLite3("../database/dict.db"); - - $table_array = array("english", "german"); - $table_count = count("$table_array"); - - $table=$table_array[0]; - - $rows = $db->query("SELECT count(*) as count FROM ". $table . ";"); - $row = $rows->fetchArray(); - $numRows = $row["count"]; - - - $random = mt_rand(1,$numRows); - $search_word_db = $db->query("SELECT word FROM " . $table . " WHERE id=" . $random . ";"); - $search_word_ar = $search_word_db->fetchArray(); - $search_word = $search_word_ar["word"]; - - return $search_word; -} |
