I've searched high and low for pointed but im driving myself bonkers in getting this working!
Building a website and trying to keep everything efficient and modular however and have problems getting my head around OOP and Arrays with MySQL.
Class ABC {
static $taken = array();
function setArray() {
//connect and query etc..
// extract all the mysql and store it in an array of taken urls
while($row = mysql_fetch_array($results)) {
$taken = $row['the_url'];
}
}
function getArray() {
//return the array so that a btree can search through them.
return $taken;
}
}
$hello = new ABC;
$hello->setArray();
$hello->getArray();
echo $hello;
however i only every seem to get the first result and doesnt seem to stay as an array
i tried seaching this website but keep getting 'daemon error' so any pointers to the right direction would be greatly appreciated!!! thankyou