Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mysql issues #450

Open
brokiem opened this issue Aug 22, 2020 · 0 comments
Open

mysql issues #450

brokiem opened this issue Aug 22, 2020 · 0 comments
Labels

Comments

@brokiem
Copy link

brokiem commented Aug 22, 2020

Error: Call to a member function fetch_array() on bool
File: plugins/EconomyAPI_v3.0.0-SNAPSHOT-4f06e8d0.phar/src/onebone/economyapi/provider/MySQLProvider
Line: 116
Type: Error

THIS CRASH WAS CAUSED BY A PLUGIN
BAD PLUGIN: EconomyAPI v3.0.0-SNAPSHOT

Code:
[107] 	 * @return float|bool
[108] 	 */
[109] 	public function getMoney($player) {
[110] 		if($player instanceof Player) {
[111] 			$player = $player->getName();
[112] 		}
[113] 		$player = strtolower($player);
[114] 
[115] 		$res = $this->db->query("SELECT money FROM user_money WHERE username='" . $this->db->real_escape_string($player) . "'");
[116] 		$ret = $res->fetch_array()[0] ?? false;
[117] 		$res->free();
[118] 		return $ret;
[119] 	}
[120] 
[121] 	/**
[122] 	 * @param Player|string $player
[123] 	 * @param float $amount
[124] 	 * @return bool
[125] 	 */
[126] 	public function setMoney($player, float $amount): bool {
@onebone onebone added the bug label Aug 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants