Dynadot โ€” .com Transfer

[Resolved] PHP Notice [error]

SpaceshipSpaceship
Watch
Impact
19
PHP Notice [error]

Hey
first of all..i have a request..can i add someone who knows php on MSN? i am working on my project and i get stuck on alot of small errors..and it sucks to post them here all and wait for half an hour :p thanks

now heres the error thats causing me pain now
i turned on the error_reporting thing and i got these:

Code:
Notice: Undefined variable: database in C:\Program Files\xampp\htdocs\FM\include\session.php on line 338

Notice: Trying to get property of non-object in C:\Program Files\xampp\htdocs\FM\include\session.php on line 338

Notice: Undefined variable: database in C:\Program Files\xampp\htdocs\FM\include\session.php on line 338

Notice: Trying to get property of non-object in C:\Program Files\xampp\htdocs\FM\include\session.php on line 338
now i have no clue why i get them..heres the code on that line
PHP:
			$admin_level = $database->configs['admin_level'];
database is a class..that i do include in sessions.php
and the configs array works on other files..for example index.php...but not here for some reason :-s
can anyone help me out?
 
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
Unstoppable Domains โ€” AI StorefrontUnstoppable Domains โ€” AI Storefront
'Notice' is the most benign error. This happens when you use an undeclared variable. It is best to set a default value to your variables, even an empty string eg:
PHP:
$variable='';
 
0
•••
yes but the variable is defined..
 
0
•••
Paste line 337. :tu:

On PHP Errors, the error usually appears on the line before the one it says.

Edit: Ok, i read the error again.
1. Did you require the file where the class is coded?
2. Did you use the "new" function somewhere in your code. Eg, $database = new Database;
 
0
•••
yes i did...anyway i fixed it..i needed to add "global $database" in that function for some reasons..but no error anymore hehe:D thanks
p.s: can someone whose gud with PHP still add me on msn [[email protected]]
 
0
•••
CatchedCatched
Escrow.com
Spaceship
Rexus Domain
CryptoExchange.com
Domain Recover
CatchDoms
DomainEasy โ€” Live Options
DomDB
  • The sidebar remains visible by scrolling at a speed relative to the pageโ€™s height.
Back