antiblock
diamwall
  • Chatbox

    You don't have permission to chat.
    Load More
Sign in to follow this  
Multi do Bizarro

[Help] Erro Esquesito Xd

2 posts in this topic

Erro: 

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'Minion', 'Grito de Guerra: Cause 1 de dano.' , 'Horde', 'Common', '1', '1' at line 1

PHP: 

	$connection = mysql_connect('localhost', 'root', '') or die(mysql_error());	$db = mysql_select_db('hstests', $connection) or die(mysql_error());	$json = file_get_contents('Basic.ptPT.json');	$bases = json_decode($json, true);		if(isset($_POST['GO'])){		$i = 1;		for (; ; ) {			if ($i > 209) {				break;			}			if(isset($bases[$i]['name']) && isset($bases[$i]['id']) && $bases[$i]['type']=='Minion'){				$nome  = utf8_decode($bases[$i]['name']);				$id    = $bases[$i]['id'];				$tipo  = $bases[$i]['type'];				if(isset($bases[$i]['text'])){					$texto = utf8_decode($bases[$i]['text']);				}				if(isset($bases[$i]['faction'])){					$fact  = $bases[$i]['faction'];				}				$rare  = utf8_decode($bases[$i]['rarity']);				//Numeros				$custo = $bases[$i]['cost'];				$ataq  = $bases[$i]['attack'];				$health= $bases[$i]['health'];								if(isset($texto)){$asd = ", `texto`";$asdad=", '".$texto."'";};				if(isset($fact)) {$asda = ", `fact`";$asdas=", '".$fact."'";};				mysql_query("INSERT INTO `unstable` (`nome`, `cardid`, `tipo`".$asd." ".$asda.", `rare`, `cost`, `att`, `hp`) VALUES ('".$nome."', '".$id.", '".$tipo."'".$asdad." ".$asdas.", '".$rare."', '".$custo."', '".$ataq."', '".$health."')") or die(mysql_error());			}			$i++;		}	}

Share this post


Link to post
Share on other sites
antiblock
diamwall

Utiliza mysqli ou PDO, recuso.me a ajudar com o MySQL, mais do que ultrapassado.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this