I have a class in which I have a function called connection. I am now trying to call this function from another class, but it will not work. It works if I put the code in from the other function rather than calling it but that defeats the purpous.
class locationbox
{
function location()
{
$databaseconnect = new databaseconnect();
$databaseconnect -> connection();{
$result = mysql_query("SELECT * FROM locations");
while($row = mysql_fetch_array($result)) // line that now gets the error, mysql_fetch_array() expects parameter 1 to be resource, boolean given //in
{
echo "<option>" . $row['location'] . "</option>";
}
}
}}