18.11.2016, 18:02
Quote:
|
I did this:
PHP код:
Код:
Warning: mysqli_close() expects parameter 1 to be mysqli, null given in ... I know what's the problem, but currently have no solution for it... I can't use variable outside of events or functions... If we can use global vars it'll work... Alt way: Make a connection each time doing something which is bad ![]() No way of having global variables, if you know a way, tell me. |
What about returning it thru a function? (Are they even added in? Like public functions)
pawn Код:
function Connect()
$connection = .... ; //mysql bla bla bla bla
return $connection;
}
Event::OnSomething() {
$conn = Connect();
}
Quote:
|
call_user_func('Connect'); |



