Мне не удалось выяснить, в чем проблема. /вар/Журнал/apache2/error_log показываетphp error показывает undefined mysqli_query
PHP Fatal error: Call to undefined function mysqli_query() in /srv/www/htdocs/platform/includes/functions.php on line 397
Я потратил огромное количество времени, пытаясь настроить стек лампы для работы на OpenSUSE Скачка. Любая помощь будет высоко оценен.
Я использую MariaDB, PHP: MySQL Ver 15.1 Distrib 10.0.28-MariaDB, для Linux (x86_64) PHP 5.5.14 (кли
Эти присоединенные функции:
//functions.php
include('database.php');
function find_all_pages_index($user="guest"){
$query = "SELECT p.pg_id,p.pg_name,p.name,u.usl_id ";
$query .= "FROM pages as p,users as u ";
$query .= "WHERE u.user_name=\"".strtolower($user)."\"";
$result=mysqli_query(dbconnect(),$query) or die("Error in query"); //This is line 397
if (mysqli_num_rows($result) > 0){
// iterate through resultset
// print title with links to edit and delete scripts
echo "<ul class=\"nav navbar-nav\">";
while($row = mysqli_fetch_row($result)){
echo "<li";
if (find_subjects_for_page2($row[0], $row[3]) == true){
echo " class=\"dropdown\" >";
echo "<a href=\"public/". strtolower($row[1]).".php\" role=\"button\" aria-haspopup=\"true\""
. " aria-expanded=\"false\">".$row[2]."<span class=\"caret\"></span></a>
<ul class=\"dropdown-menu\">";
find_subjects_for_page($row[0],$row[3]);
} else {
echo ">";
echo "<a href=\"public/". strtolower($row[1]).".php\">";
echo $row[2]."</a>";
}
echo "</li>";
}
echo "</ul>";
}
}
//database.php
function dbconnect(){//function to connect to the database
if (!defined("DB_HOST")){define("DB_HOST","localhost");}
if (!defined("DB_USER")){define("DB_USER","platform");}
if (!defined("DB_PWORD")){define("DB_PWORD","platform");}
if (!defined("DB_NAME")){define("DB_NAME","platform");}
$connection=mysqli_connect(DB_HOST,DB_USER,DB_PWORD,DB_NAME);
if (mysqli_connect_errno()){//check if there is a connection error number
//display error and error number if error number exists
die ("Could not connect to database ".mysqli_connect_error()." (".mysqli_connect_errno().")");
} else {//return connection handle if there is no error number
return $connection;
}
}
function confirm_query($result,$query){
if (!$result){//check if query was ok
die ("Data upload failed: $query");
}
}
у вас включен Mysqli расширения? 'расширение = mysqli.so' – deoliveiralucas
http://stackoverflow.com/questions/25281467/fatal-error-call-to-undefined-function-mysqli-connect – jophab
Как включить расширение mysqli в OpenSUSE Leap? – giantas