diff options
Diffstat (limited to 'bPod/php/buckyk.php')
| -rw-r--r-- | bPod/php/buckyk.php | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/bPod/php/buckyk.php b/bPod/php/buckyk.php new file mode 100644 index 0000000..bda0355 --- /dev/null +++ b/bPod/php/buckyk.php @@ -0,0 +1,37 @@ + <?php + + // TOUCH NOT LEST YE BE TOUCHED _______________________________ + + mysql_connect ("localhost","tfarnon","blunderbus"); // lol security + mysql_select_db ("bucky"); + + $query = mysql_query ("SELECT * FROM `keywords` order by `keyword` asc"); + + $nrows = mysql_num_rows ($query); + + if (!isset ($_GET['s']) || !isset ($_GET['e'])) { + $startIndex = 0; + $endIndex = $nrows; + } else { + $startIndex = $_GET['s']; + $endIndex = $_GET['e']; + } + + if ($startIndex != 0) { + $page = ($endIndex - $startIndex); // select a set between _ and _ + } else { + $page = $nrows; // select all from _ + } + + // SET UP STRING BELOW HERE ___________________________________ + + $rString = "&numItems=" . $page; + + for ($i = 0 ; $i <= $endIndex; $i++) { + $row = mysql_fetch_array($query); + $rString .= "&keyword" .$i ."=". $row['keyword']; + if ($row['color']) $rString .= "&color" .$i ."=". $row['color']; + else $rString .= "&color" .$i ."=". "plain"; + } + echo $rString; +?>
\ No newline at end of file |
