I had an idea to use arrays and this is the idea in PHP:
in a php file:
Code: Select all
$DB->set_query("SELECT `Visit_Count` FROM `{$DB->Table}`", 'GET_VISIT_COUNT');
$DB->set_query("SELECT `Visit_Count_Unique` FROM `{$DB->Table}`", 'GET_VISIT_COUNT_UNIQUE');
// @param: query to be executed
// @param: identifier for query
Code: Select all
<?php
// snipped
class DB {
// snipped
/*
| set_query() assigns the necessary statements
| for later use
*/
public function set_query($_Query, $_Query_Id = NULL)
{
$this->Query['Query'][] = $_Query;
$this->Query['ID'][] = $_Query_Id;
$this->Query['Result'][] = mysql_query($this->Query[$_Query]);
}
/*
| run_query() returns the query that was passed
| in set_query() so it can be used in a way
| that wont give a 'isnt valid resource' warning
*/
public function run_query($_Query_Id)
{
return $this->Query['Result'][0];
}
// snipped
}
Any help would be muchly appreciated!