[Solved] php errors – Notice: Undefined variable: iAccount_db in D:\iac\htdocs\datas\scripts\iAccount_core.inc.php on line 135 [closed]


Ok, now that you posted some code, you’re defining $iAccount_db in the correct place, but you’re trying to access it when inside the scope of a funcion , while the variable is defined outside of it.

Bad solution: make $iAccount_db global (not recommended)

A variant to this would be to make those variable CONSTANTS, since actually that’s what they are.

Better solution: pass the variable as an argument to your function:

function iAccount_level_update($user, $iAccount_db){ }

Also, your queries are vulnerable to SQL injection (use mysql_real_escape_string at the very least, when required), I suggest switching to mysqli or even better PDO and use query parametrization.

2

solved php errors – Notice: Undefined variable: iAccount_db in D:\iac\htdocs\datas\scripts\iAccount_core.inc.php on line 135 [closed]