The following warnings occurred:
Warning [2] Undefined variable $unreadreports - Line: 26 - File: global.php(961) : eval()'d code PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/global.php(961) : eval()'d code 26 errorHandler->error
/global.php 961 eval
/showthread.php 28 require_once





× This forum is read only. As of July 23, 2019, the UserSpice forums have been closed. To receive support, please join our Discord by clicking here. Thank you!

  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
function didn't work
#1
Hello all from Soggy Houston, TX!

I tried this function:


function getConfig ($search='')
{
require_once 'users/init.php';
require_once $abs_us_root.$us_url_root.'users/includes/header.php';
$config = $db->query("select options from config where setting = ?",array($search));
$back = $config->first()->options;
return $back;
}

and received the following errors:

Notice: Undefined variable: abs_us_root in C:\xampp\htdocs\follower\function.php on line 7

Notice: Undefined variable: us_url_root in C:\xampp\htdocs\follower\function.php on line 7

Notice: Undefined variable: db in C:\xampp\htdocs\follower\function.php on line 8

Fatal error: Uncaught Error: Call to a member function query() on null in C:\xampp\htdocs\follower\function.php:8 Stack trace: #0 C:\xampp\htdocs\follower\index.php(11): getConfig('logo') #1 {main} thrown in C:\xampp\htdocs\follower\function.php on line 8

This was to the call of: $set = getConfig('logo');

Can anyone point me where I went wrong?
  Reply


Messages In This Thread
function didn't work - by Katronix - 08-31-2017, 01:53 AM
function didn't work - by Brandin - 08-31-2017, 11:17 AM
function didn't work - by Katronix - 09-01-2017, 01:27 AM
function didn't work - by mudmin - 09-01-2017, 12:23 PM
function didn't work - by mg0411ph - 03-04-2018, 05:51 PM
function didn't work - by dan - 03-04-2018, 05:56 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)