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
#6
Functions are sort of like standalone programs. If you want them to have access to things outside them, you usually have to bring it inside the scope of the function. That means instantiating the class, calling the function, or using a global. For instance... Iirc, you can do global $db; to use the db class that was already instantiated in the header. This can get weird if you reuse that variable name somewhere else on the page.
  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: 2 Guest(s)