For example:
<?
function getTitle(){
$query="SELECT title FROM news WHERE author = 'admin' LIMIT 5";
$result = mysql_query($query, $mysql_connection);
$data = mysql_fetch_array($result,MYSQL_ASSOC);
return $data['title'];
}
?>
And every time I want to submit a MySql query I must always include config.php inside the function, otherwise it does not work. I tried including at the beginning of the file but still no result.
Config.php file consists of connection to the database and selection of the database. No errors there.
What seems to be the problem?