Ir para conteúdo

Arquivado

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

Emerson Placido

com While

Recommended Posts

Bom Dia AMIGOS, estou com problemas para dar manutenção em um Codigo, gostaria saber onde eu insiro um while no codigo abaixo. .

 

$ckey = $_REQUEST['ckey']; $customerid = !isset($_REQUEST['customerid'])?1:$_REQUEST['customerid'];$fromtable = " FROM " . TABLECUSTOMER . "," . TABLECATEGORY;$query = "SELECT * $fromtable WHERE " . TABLECUSTOMER . ".customerid=" . TABLECATEGORY . ".fkcustomerid". " AND " . TABLECATEGORY . ".status='approved' AND " . TABLECATEGORY . ".expires >'$todaysDate' AND description like '%$ckey%' ";// DEBUGGING CODE - start include("sql_view.php");// DEBUGGING CODE - end// pconnect, select and queryif ($link_identifier = mysql_pconnect(DBSERVERHOST, DBUSERNAME, DBPASSWORD)) {	if ( mysql_select_db(DBNAME, $link_identifier)) {		// run the query   	$queryResultHandle = mysql_query($query, $link_identifier) or die( mysql_error() );		 $rows = mysql_num_rows($queryResultHandle);		if ( $rows > 0 ) {					$data = mysql_fetch_array ($queryResultHandle);								require("generic_stripslashes.php");			echo  $bizlist_submit_label; "\n<table><tr><td>\n";			include_once("templates/header.php");			include("showOneRecord.php");			echo"</td></tr></table>";		}else{ // if ( $rows > 0			echo"<p style=\"color:red;font-weight:bold;\">Sem Resultado para a procura</p>";		}	}else{ // select		echo mysql_error();	}}else{ //pconnect	echo mysql_error();}

Ja coloque aqui mas deu tempo esgotado

 

while		($data = mysql_fetch_array ($queryResultHandle));

Compartilhar este post


Link para o post
Compartilhar em outros sites

Você colocou ponto-e-vírgula no final da função mysql_fetch_array(). Você deve colocar chaves:

 

while ($data = mysql_fetch_array ($queryResultHandle)){
  echo $data['id'].$data['x'].$data['y'];
}

[]'s

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.