config(); $db = mysql_connect($c[0], $c[1], $c[2]) or die(mysql_error()); $sdb = mysql_select_db($c[3], $db) or die(mysql_error()); } return $sdb; } function q($token)//is what it sounds like { //set qq to global, just in case global $qq; //open the database $this->open(); //run your query based on your generic token or arbitrary value $qq = mysql_query($token); if (mysql_num_rows($qq) > 0) { //check to see if you got anything back //if you did, set the increment to 0 and begin your while loop. $i = 0; while ($rs = mysql_fetch_array($qq)) { //throw the entire row into the runQuery array $runQuery[$i] = $rs; //increment i $i++; } //return the full array of goodness. return $runQuery; } else { //but make sure to return the term 'nothing' if that's all you find. return 'nothing'; } } } ?>