Welcome Guest, Not a member yet? Register   Sign In
Adding standalone blog
#3

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?
Reply


Messages In This Thread
Adding standalone blog - by keld - 06-07-2015, 05:04 PM
RE: Adding standalone blog - by josetrindade - 06-08-2015, 05:18 AM
RE: Adding standalone blog - by keld - 06-10-2015, 02:09 PM
RE: Adding standalone blog - by mwhitney - 06-11-2015, 12:09 PM



Theme © iAndrew 2016 - Forum software by © MyBB