Ir para conteúdo

Arquivado

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

thiago_php

Parse error: syntax error, unexpected $end

Recommended Posts

alguem sabe q erro e esse, so que na linha 258 nao existe nao tem nada na linha 258Parse error: syntax error, unexpected $end in C:\Apache2\htdocs\sitepaulista(novo)\busca_medico.php on line 258

Compartilhar este post


Link para o post
Compartilhar em outros sites

beleza ja vi ond tava errando nesse erro

to com outro problema sei q to sendo chato consegui faze funcionar ate aki fui alterando e ta funcionando

o problema é se eu buscar por "a" por exemplo ele aparece assim pra mim

 

[<] 1 2 3 4 5 [>]

 

sendo que tem a 6 pagina mas nao aparece ali ele so aparece se eu clicar na seta so assim

 

 

<form name="form1" method="get" action="busca_medico.php">					  <input name="busca" type="text" id="busca">					  <input type="submit" name="Submit" value="Submit">					</form></td>				</tr>				<tr> 				  <td> <div align="left"> <?include("../../../Apache2/htdocs/sitepaulista(novo)/Connections/conexao2.php"); //Conecta com o banco de dados MySQL   include ("paginacao.php");   if ($_POST['busca'])		$busca = $_POST['busca']; //recebe a palavra do form buscaelseif ($_GET['busca'])		$busca = $_GET['busca']; //recebe a palavra do form busca									//SQL COM FILTROS DO RESULTADO   $sql = "SELECT medicos.medico, especialidades.especialidades, medicos.desc_atend from (medico_especialidades INNER JOIN medicos ON medico_especialidades.id_medico = medicos.id_medico)INNER JOIN especialidades ON medico_especialidades.id_especialidades = especialidades.id_especialidades WHERE medicos.medico LIKE '$busca%' Order by medicos.medico";	//NUMERO DE REGISTROS POR PÁGINA	$qtde_pag = 1;	//NUMERO DE COLUNAS DA TABELA RESULTADO	$qtde_campos = 5;	//NOMES DOS TÍTULOS E TAMANHOS DAS COLUNAS DA TABELA RESULTADO	$titulos = array();	$titulos[0][0] = "Medico";	$titulos[0][1] = "width=\"10%\"";	$titulos[1][0] = "Especialidade";	$titulos[1][1] = "width=\"10%\"";	$titulos[2][0] = "Horario de Atendimento";	$titulos[2][1] = "width=\"15%\"";   	//PROPRIEDADES DOS TÍTULOS	$titulosProp = "class=\"titulo\"";	//ALINHAMENTO DAS COLUNAS DE RESULTADOS	$linhas[0] = "align=\"center\"";	$linhas[1] = "align=\"center\"";	$linhas[2] = "align=\"left\"";	$linhas[3] = "align=\"left\"";	$linhas[4] = "align=\"left\"";	//PROPRIEDADES DAS LINHAS DE RESULTADOS	$linhasProp = "class=\"linha\" ";	$linhaAlternada = "style=\"background:#E3E3E3;\" ";	//PROPRIEDADES DA TABELA	$tabelaProp = "cellpadding=\"2\" cellspacing=\"0\" width=\"600\" class=\"bordasimples\"";	//PROPRIEDADES DOS LINKS	$linksProp[0] = "class=\"a\"";	$linksProp[1] = "align=\"center\"";	//QUANTIDADE DE LINKS DE PÁGINAS	$rangePag = 8;?> <?			//CHAMA A FUNÇÃO QUE GERA A PAGINAÇÃO			paginacao($sql, $qtde_campos, $qtde_pag, $titulos, $titulosProp, $linhas, $linhasProp, $linhaAlternada, $tabelaProp, $linksProp, $rangePag);								?>

 

paginacao.php

 

<?	function paginacao($sql, $qtde_campos, $qtde_pag, $titulos, $titulosProp, $linhas, $linhasProp, $linhaAlternada, $tabelaProp, $linksProp, $rangePag)	{		global $busca;		//VERIFICA EM QUAL PÁGINA ESTÁ		if (isset($_GET['pagina']))		{			$pagina = $_GET['pagina'];			$limite_inf = ($pagina - 1) * $qtde_pag;		}		else		{			$pagina = 1;			$limite_inf = 0;		}		//IMPRESSÃO DO CABEÇALHO DA TABELA		echo "<TABLE " . $tabelaProp . ">\n";		//QTDE DE LINHAS DA CONSULTA		conecta();		$resp = mysql_query($sql);		desconecta();		$qtde_total = mysql_num_rows($resp);		//QTDE DE PÁGINAS DA CONSULTA		$qtde_mod = $qtde_total % $qtde_pag;		$qtde_pags = intval(($qtde_total - $qtde_mod) / $qtde_pag);		if ($qtde_mod > 0)			$qtde_pags++;		//IMPRIME OS TÍTULOS		$qtde_titulos = count($titulos);		$titulo = "<TR>\n";		for($i=0;$i<$qtde_titulos;$i++)		{			$titulo .= "<TD " . $titulosProp . " " . $titulos[$i][1] . ">" . $titulos[$i][0] . "</TD>\n";		}		$titulo .= "</TR>\n";		echo $titulo;		//IMPRIME OS RESULTADOS		$sql_exec = $sql . " limit $limite_inf, $qtde_pag";		conecta();		$resp = mysql_query($sql_exec);		desconecta();		$qtde_reg = mysql_num_rows($resp);		for($x=0;$x<$qtde_reg;$x++)		{			if ($x % 2 != 0)				$dif = $linhaAlternada;			else				$dif = "";			$campos = mysql_fetch_row($resp);			$linha = "<TR>\n";			for($j=0;$j<$qtde_campos;$j++)			{				$linha .= "<TD " . $linhas[$j] . " " . $dif . $linhasProp . ">" . $campos[$j] . "</TD>\n";			}			$linha .= "</TR>\n";			echo $linha;		}		//IMPRIME OS LINKS PARA OUTRAS PÁGINAS		$primeiraPag = $pagina - (intval(($rangePag - ($rangePag % 2)) / 2));	   $primeiraPag = 1;$ultimaPag = $qtde_pags;$links = "<TR>\n<TD " . $linhasProp . " " . $linksProp[1] . " colspan=\"" . $qtde_campos . "\">\n";		$links .= "<A " . $linksProp[0] . " href=\"" . $PHP_SELF . "?pagina=1&busca=$busca\">[<]</A>\n";		for($i=$primeiraPag;$i<$ultimaPag;$i++)		{			if ($pagina == $i)				$links .= "$i\n";			else				$links .= "<A " . $linksProp[0] . " href=\"" . $PHP_SELF . "?pagina=$i&busca=$busca\">[$i]</A>\n";		}		$links .= "<A " . $linksProp[0] . " href=\"" . $PHP_SELF . "?pagina=$qtde_pags&busca=$busca\">[>]</A>\n";		$links .= "</TD>\n</TR>\n";		echo $links;		echo "</TABLE>\n";	}?>

Compartilhar este post


Link para o post
Compartilhar em outros sites

entao mudei pra 14 mas continua a mesma coisa alterei para outros valores mas nao vi diferenca e continua a mesma coisaele aparece assim[<] [1] [2] [3] [4] [5] [>] aparece so 5 link sendo que tem 6 so consigo ver o sexto link se eu clicar na setaok valeu

Compartilhar este post


Link para o post
Compartilhar em outros sites

[entao parece q a variavel $rangePag cnao ta funcionando porque fiz uma busca em outra tabela e apareceu assim os links

 

 

[<] [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11]

[12] [13] [14] [15] [16] [17] [18] [19] [20]

[21] [22] [23] [24] [25] [26] [27] [28] [29]

[30] [31] [32] [33] [34] [35] [36] [37] [38]

[39] [40] [41] [42] [43] [44] [45] [46] [47]

[48] [49] [50] [51] [52] [53] [54] [55] [56]

[57] [58] [59] [60] [61] [62] [63] [64] [65]

[66] [67] [68] [69] [70] [71] [72] [73] [74]

[75] [76] [77] [78] [79] [80] [81] [82] [83]

[84] [85] [86] [87] [88] [89] [90] [91] [92]

[93] [94] [95] [96] [97] [98] [99] [100] [101]

[102] [103] [104] [105] [106] [107] [108]

[109] [110] [111] [112] [113] [114] [115]

[116] [117] [118] [119] [120] [121] 122

[123] [>]

 

deus me deem uma luz haaa http://forum.imasters.com.br/public/style_emoticons/default/dormindo.gif

Compartilhar este post


Link para o post
Compartilhar em outros sites

ate que fim funcionou entao tenho uma duvida quando faco uma busca a url aparece assim

 

/busca_medico_espec.php?pagina=1&busca=Labirintite

 

nesse 1 se eu colocar 0 aparece esse erro

 

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in C:\Apache2\htdocs\sitepaulista(novo)\paginacao.php on line 48

 

queria saber se tem algum script para tratar isso embaralhar a url nao deixar o usuario mexer na url

 

valeu

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.