When I try to enter my web page to continue with my project, I receive the following error:
Fatal error: Cannot redeclare selectValue() (previously declared in /home/admin/web/jobs.carinae-studios.com/public_html/rewrite/includes/functions.php:4) in /home/admin/web/jobs.carinae-studios.com/public_html/rewrite/includes/functions.php on line 4
I know that this error is caused when you use more than one time require or include, but my case is very strange, since last day, everything was working perfectly, and going to bed and waking up to continue programming , I started receiving this error without any reason. In all my code I use require_once, and never require or include to dry. Is there any solution to this problem ?, I will leave a small part of my code, because it is very large.
index.php: 1: 22
<?php
require_once "includes/functions.php";
require_once "includes/settings.php";
require_once "includes/steamauth.php";
if(!isLogged()){
header("Location: login/");
}else{
require_once "includes/userInfo.php";
}
if(!userExists($_SESSION['steamid'])){
header("Location: login/process_login.php");
}else{
$lock = isLocked();
if($lock == "true"){
header("Location: ".$settings['domain']."lockscreen.php");
}
}
require_once "includes/db.php";
require_once "includes/profile_functions.php";
?>
includes / functions.php: 1: 24
<?php
error_reporting(E_ALL & ~E_NOTICE);
function selectValue($table, $value){
require_once "db.php";
$res = $conn->query("SELECT ".$value." FROM ".$table);
if ($res->num_rows > 0) {
while($row = $res->fetch_assoc()) {
return $row[$value];
}
}
$conn->close();
}
function selectValueWhere($table, $value, $where, $equals){
require_once "db.php";
$res = $conn->query("SELECT ".$value." FROM ".$table." WHERE ".$where." = ".$equals);
if ($res->num_rows > 0) {
while($row = $res->fetch_assoc()) {
return $row[$value];
}
}
$conn->close();
}