Thanks, using
PHP Code:
<?php include(FCPATH."/blogger/blog.php"); ?>
worked but now I have another problem.
The blog config file contains this
PHP Code:
if ($installed!='yes') {
$connBl = mysqli_connect($CONFIG["hostname"], $CONFIG["mysql_user"], $CONFIG["mysql_password"], $CONFIG["mysql_database"]);
if (mysqli_connect_errno()) {
die('MySQL connection error: .'.mysqli_connect_error());
}
mysqli_set_charset($connBl, "utf8");
}
// function that replace SELECT, INSERT, UPDATE and DELETE sql statements
if(!function_exists('sql_result')){
function sql_result($sql) {
global $connBl;
echo "connBL = ".$connBl;die();
$sql_result = mysqli_query ($connBl, $sql) or die ('Could not execute MySQL query: '.$sql.' . Error: '.mysqli_error($connBl));
return $sql_result;
}
}
and in the sql_result function, somehow global $connBl is empty so I get an error fetching the results from the database but there's no error connecting to the DB, mysqli_connect_error() returns no error.
Now what's interesting is that I don't get that error and the blog displays fine if I access to it directly from the URL (mysite.com/blog/blog.php) but inserting it into a view makes the global variable not working. Is that a CI thing?