Ir para conteúdo

POWERED BY:

Arquivado

Este tópico foi arquivado e está fechado para novas respostas.

Yuri Vidal

[Resolvido] Erro de syntax php

Recommended Posts

Dá o seguinte erro ao tenta exeutar a página abaixo:

Parse error: syntax error, unexpected '}' in /home/brteamco/public_html/sitel2/paginas/grandboss.php on line 116

 

 

<?

////////////P�gina para Boss - By Roberto Filho///////////////////
$MySQL_servidor = "localhost";    //IP  do Servidor / Host
$MySQL['porta'] = "3306";    //Porta MySQL [Padr�o - 3306]
$GameServer['porta'] = "7777";
$MySQL['usuario'] = "root";                //Login MySql [Padr�o - Root]
$MySQL['senha'] = "minhasenha";            //Senha MySql [Padr�o - Root]
$MySQL['banco'] = "l2jdb";             //Banco de Dados Lineage 2


mysql_connect($MySQL['servidor'], $MySQL['usuario'], $MySQL['senha']) or die ("Nao foi possivel se conectar ao Banco de Dados.");
mysql_select_db($MySQL['banco']) or die ("Banco de Dados Nao Existe.");
?>
<title>
Informa��es Grand Boss
</title>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Informações Raid Boss</title>
<link rel="shortcut icon" href="../imagens/favicon2.ico" type="image/x-icon" />
<style type="text/css" media="screen">
body {
	background:#000 url(../imagens/page_bg.jpg) left top repeat-x;
	color:#fff;
	font-family:Arial, Helvetica, sans-serif
}
a:link, a:visited, a:hover {
	color:#f2f2f2;
	text-decoration:none;
}
a:active {
	color:#fff;
	text-decoration:underline;
}
.style1 { background-color:#252525 }
.style2 {
	color:#900;
	font-weight:bold;
}
.style3 { background-color:#353535; }
.style10 { font-size:12px; }
.vivo { color:#0c0; }
.morto { color:#f00; }
.spawn { color:#09f }
.respawntime { color:#f90 }
#table_boss {
	border:none;
	color:#fff;
	width:100%;
}
#table_boss caption { padding:5px 0 }
#table_boss tr td {
	text-align:center;
	border:1px solid #444;
}
#table_boss tr.t_corpo:hover td {
	background-color:#444;
	color:#ff0;
	font-weight:bold;
}
#table_boss tr.topo {
	color:#fff;
	font-weight:bold;
	font-size:16px;
}
#table_boss tr.topo td {
	background-color:#252525;
	background:#191919 url(../imagens/menu_hover.png) left bottom repeat-x;
}
#table_boss tr.topo td.t1 { width:40% }
#table_boss tr.topo td.t2 { width:15% }
#table_boss tr.topo td.t3 { width:30% }
</style>
</head>
<body>
<?php
include "config/config.php";
$raidspawn = mysql_query("SELECT * FROM 
( 
(select boss_id idx,respawn_time tempo FROM raidboss_spawnlist WHERE boss_id IN(25325)) 
UNION ALL 
(select boss_id idx,respawn_time tempo FROM grandboss_data where boss_id in (29001,29006,29014,29022,29020,29019,29028,29047)) 
) x
ORDER BY tempo DESC");

print("<table cellspacing=\"0\" cellpadding=\"0\" border=\"0\" width=\"100%\">");

while(list($boss_id,$respawn_time) = mysql_fetch_row($raidspawn))
{
	
	$raidnames = mysql_query("SELECT name FROM npc WHERE id = $boss_id");
	$text = '<font color="00FF00">Vivo</font>';
	$respawn = '<font color="00FF00">Vamos matar...</font>';

	if($respawn_time > 0)
	{
		$respawntime = date('d/m/Y \�\s H:i:s',($respawn_time / 1000));;
		$text = '<font color="FF0000">Morto</font>';
		$respawn = '<font color="FF0000">Renasce dia '.$respawntime.'</font>';
	}

	while(list($raidname) = mysql_fetch_row($raidnames))
	{
		print("<tr>");
		print("<td valign=\"top\" width=\"160\">".(file_exists("boss/".$raidname.".jpg") ? "<img src=\"boss/".$raidname.".jpg\" border=\"0\" />" : "Sem Imagem")."</td>");
		print("<td valign=\"top\">");
		print("<h3>".$raidname."<!--($boss_id)--></h3>");
		print("Estado: <strong>".$text."</strong><br />");
		print("<strong>".$respawn."</strong><br />");
		print("</td>");
		print("</tr>");
	}
}
print("</table>");
}
?>
</table>
<?
$prev = $pagina - 1;
$next = $pagina + 1;

/*  if ($pagina > 1) {
    $prev_link = "<a href=\"$PHP_SELF?pagina=$prev\">Anterior</a>";
  } else {
    $prev_link = "Anterior";
  }

  if ($paginas > $pagina) {
    $next_link = "<a href=\"$PHP_SELF?pagina=$next\">Pr�xima";
  } else {
    $next_link = "Pr�xima";
  }



  $painel = "";
          for ($x=1; $x<=$paginas; $x++) {
              if ($x==$pagina) {
              $painel .= " [$x] ";
              } else {
              $painel .= " <a href=\"$PHP_SELF?pagina=$x\">[$x]</a>";
              }
          }
*/

echo "<p align=center>$prev_link  $painel $next_link</p>";

?>

Alguem pode me ajudar??

obrigado!!!

Compartilhar este post


Link para o post
Compartilhar em outros sites

Aponte o trecho que está dando o erro.

 

nesse aqui:

}
}
print("</table>");
}
?>

linha 116 do configo que passei la em cima...

 

Verifique o números de chaves! {

 

Tem 7, eu ja retirei a ultima para fica rpar e não deu certo :S pdoeria corrigir para mim por favor? essa parte de chaves eu sempre me confundo :S

 

agradeço desde já!

Compartilhar este post


Link para o post
Compartilhar em outros sites

tinha uma chave a mais

use um IDE para programar ele corrige na hora os erros ok

 

da uma olhada no google:

Netbeans

Eclipse php

Aptana studio

 

 

<?php
include "config/config.php";
$raidspawn = mysql_query("SELECT * FROM 
( 
(select boss_id idx,respawn_time tempo FROM raidboss_spawnlist WHERE boss_id IN(25325)) 
UNION ALL 
(select boss_id idx,respawn_time tempo FROM grandboss_data where boss_id in (29001,29006,29014,29022,29020,29019,29028,29047)) 
) x
ORDER BY tempo DESC");

print("<table cellspacing=\"0\" cellpadding=\"0\" border=\"0\" width=\"100%\">");

while(list($boss_id,$respawn_time) = mysql_fetch_row($raidspawn))
{

$raidnames = mysql_query("SELECT name FROM npc WHERE id = $boss_id");
$text = '<font color="00FF00">Vivo</font>';
$respawn = '<font color="00FF00">Vamos matar...</font>';

if($respawn_time > 0)
{
$respawntime = date('d/m/Y \�\s H:i:s',($respawn_time / 1000));;
$text = '<font color="FF0000">Morto</font>';
$respawn = '<font color="FF0000">Renasce dia '.$respawntime.'</font>';
}

while(list($raidname) = mysql_fetch_row($raidnames))
{
print("<tr>");
print("<td valign=\"top\" width=\"160\">".(file_exists("boss/".$raidname.".jpg") ? "<img src=\"boss/".$raidname.".jpg\" border=\"0\" />" : "Sem Imagem")."</td>");
print("<td valign=\"top\">");
print("<h3>".$raidname."<!--($boss_id)--></h3>");
print("Estado: <strong>".$text."</strong><br />");
print("<strong>".$respawn."</strong><br />");
print("</td>");
print("</tr>");
}
}
print("</table>");

?>

Compartilhar este post


Link para o post
Compartilhar em outros sites

deu certo.... obrigado!!!

agora aproveitando o tópico( não sei se estou errado...) mas, poderia me dizer o pq nesse código não está aparecendo a imagem:

<?php
$raidspawn = mysql_query("SELECT * FROM 
( 
(select boss_id idx,respawn_time tempo FROM raidboss_spawnlist WHERE boss_id IN(25325)) 
UNION ALL 
(select boss_id idx,respawn_time tempo FROM grandboss_data where boss_id in (29001,29006,29014,29022,29020,29019,29028,29047)) 
) x
ORDER BY tempo DESC");

print("<table cellspacing=\"0\" cellpadding=\"0\" border=\"0\" width=\"100%\">");

while(list($boss_id,$respawn_time) = mysql_fetch_row($raidspawn))
{

$raidnames = mysql_query("SELECT name FROM npc WHERE id = $boss_id");
$text = '<font color="00FF00">Vivo</font>';
$respawn = '<font color="00FF00">Vamos matar...</font>';

if($respawn_time > 0)
{
$respawntime = date('d/m/Y \\- H:i:s',($respawn_time / 1000));;
$text = '<font color="FF0000">Morto</font>';
$respawn = '<font color="FF0000">Renasce dia '.$respawntime.'</font>';
}

while(list($raidname) = mysql_fetch_row($raidnames))
{
print("<tr>");
print("<td valign=\"top\" width=\"160\">".(file_exists("boss/".$raidname.".jpg") ? "<img src=\"boss/".$raidname.".jpg\" border=\"0\" />" : "Sem Imagem")."</td>");
print("<td valign=\"top\">");
print("<h3>".$raidname."<!--($boss_id)--></h3>");
print("Estado: <strong>".$text."</strong><br />");
print("<strong>".$respawn."</strong><br /><br>");
print("</td><br>");
print("</tr>");
}
}
print("</table>");

?>

Só aparece assim: "Sem Imagem" :S os arquivos estão tudo no diretório certo sabe me dizer se é algum erro de váriavel?

 

agradeço desde já...

Compartilhar este post


Link para o post
Compartilhar em outros sites


<?php

//bom ve se a tua variavel $raidname existe e posta o resultado ai flw

echo"$raidname";// ve se imprime algo se nao ta com outro erro no codigo

if($raidname==true)

{

echo"A Variavel- $raidname - existe";

}

else

{

echo"variavel não esta sendo imprimidae não existe tem algum erro ";

}

?>

Compartilhar este post


Link para o post
Compartilhar em outros sites

<?php
//bom ve se a tua variavel $raidname existe e posta o resultado ai flw
echo"$raidname";// ve se imprime algo se nao ta com outro erro no codigo
if($raidname==true)
{
echo"A Variavel- $raidname - existe";
}
else
{
echo"variavel não esta sendo imprimidae não existe tem algum erro ";
}
?>

Deu isso:

variavel não esta sendo imprimida e não existe tem algum erro

Compartilhar este post


Link para o post
Compartilhar em outros sites

×

Informação importante

Ao usar o fórum, você concorda com nossos Termos e condições.