Jump to content

Help with: mysql_fetch_array() expects parameter 1 to be resource, boolean given


makedonos

Recommended Posts

Can help me with "mysql_fetch_array() expects parameter 1 to be resource, boolean given" error on this code:

 

<?
require "../includes/functions.php";

//configura
if (isset($_POST["values"])) $values = $_POST["values"];

//conecta com o banco de dados
conecta();

//altera dados
$salert = "";
$salert1 = "";
if (isset($_POST["exec"])){
if ($_POST["exec"]=='alt')
	$bdone=false;
	$verifica = mysql_query("select count(*) from FUK_001AGENDACONFIG where ATSV001FUNCIONAMENTOINICIO='" . $_POST["ATSV001FUNCIONAMENTOINICIO"] . "' and ATSV001ALMOCOINICIO='" . $_POST["ATSV001ALMOCOINICIO"] . "' and ATNI001DURACAO=" . $_POST["ATNI001DURACAO"] . " and ATNI001INTERVALO=" . $_POST["ATNI001INTERVALO"] . " and ATBL001SABADOS=" . $_POST["ATBL001SABADOS"] . " and ATBL001DOMINGOS=" . $_POST["ATBL001DOMINGOS"] . " and ATNI001ANTECEDENCIA=" . $_POST["ATNI001ANTECEDENCIA"] . " and ATNI001LIMITEMES=" . $_POST["ATNI001LIMITEMES"] . " and ATSV001SABADOSINICIO='" . $_POST["ATSV001SABADOSINICIO"] . "' and ATSV001SABADOSFINAL='" . $_POST["ATSV001SABADOSFINAL"] . "' and ATSV001DOMINGOSINICIO='" . $_POST["ATSV001DOMINGOSINICIO"] . "' and ATSV001DOMINGOSFINAL='" . $_POST["ATSV001DOMINGOSFINAL"] . "'");
	$averifica = mysql_fetch_array($verifica);
	if($averifica[0] == 0){
		$compromissos = mysql_query("SELECT count(*) FROM fuk_003agenda where ATDT003VISITA >= '" . date("Y") . ":" . date("m") . ":" . date("d") . "' ");
		$acompromissos = mysql_fetch_array($compromissos);
		if ($acompromissos[0]>0) $salert =  "* Existem vários compromissos agendados              \\ncom a configuração anterior verifique se\\nnão há necessidade de reagendamento;";
		mysql_free_result($compromissos);
		mysql_query(consulta('FUK_001AGENDACONFIG', 1));
	}
	mysql_free_result($verifica);
if (isset($_POST["ATDT002DATA"])){
	foreach($_POST["ATDT002DATA"] as $sdata){
		$verifica = mysql_query("select count(*) from FUK_002FERIADOS where ATDT002DATA = '$sdata'");
		$averifica = mysql_fetch_array($verifica);
		if ($averifica[0]==0){
			mysql_query("insert into FUK_002FERIADOS (ATDT002DATA, ATBL002EXISTE) VALUES ('$sdata', 1)");
			$adata = split('-', $sdata);
			$verifica1 = mysql_query("select count(*) from fuk_003agenda where month(ATDT003VISITA) = '" . $adata[1] . "' and day(ATDT003VISITA) = '" . $adata[2] . "' and year(ATDT003VISITA) >= '" . date("Y") . "'");
			$averifica1 = mysql_fetch_array($verifica1);
			if ($averifica1[0]>0)
				$salert1 .= "* Exixtem agendamentos no feriado do dia " . $adata[2] . "/" . $adata[1] . ";\\n";
			mysql_free_result($verifica1);
		} else
			mysql_query("update FUK_002FERIADOS set ATBL002EXISTE=1 where ATDT002DATA='$sdata'");
		mysql_free_result($verifica);
	}
	mysql_query("delete from FUK_002FERIADOS where ATBL002EXISTE=0");
	mysql_query("update FUK_002FERIADOS set ATBL002EXISTE=0");
	if ($salert != '')
		$salert = $salert . "\\n";
	if ($salert1 != '' || $salert != '')
		$salert = " <script>alert('" . $salert . $salert1 . "');</script>";
}
}

//recupera dados de configuração
$consulta = 'select PKNI001ID, ATSV001FUNCIONAMENTOINICIO, ATSV001FUNCIONAMENTOFINAL, ATSV001ALMOCOINICIO, ATSV001ALMOCOFINAL, ATNI001DURACAO, ATNI001INTERVALO, ATBL001SABADOS, ATBL001DOMINGOS, ATNI001ANTECEDENCIA, ATNI001LIMITEMES, ATSV001SABADOSINICIO, ATSV001SABADOSFINAL, ATSV001DOMINGOSINICIO, ATSV001DOMINGOSFINAL from FUK_001AGENDACONFIG order by PKNI001ID desc LIMIT 1';
$config = mysql_query($consulta);
if (mysql_affected_rows()==0){
mysql_query('insert into FUK_001AGENDACONFIG (PKNI001ID) values (1)');
$config = mysql_query($consulta);
}
while ($alinha = mysql_fetch_array($config, MYSQL_ASSOC)) {
$bex = true;
foreach ($alinha as $id => $valor) {
	$$id = $valor;
}
}
mysql_free_result($config);

//recupera datas de feriados
$consulta = 'select ATDT002DATA from FUK_002FERIADOS order by ATDT002DATA';
$datas = mysql_query($consulta);
if (mysql_affected_rows()!=0){
$isequencia=0;
while ($line = mysql_fetch_array($datas, MYSQL_ASSOC)) {
        $adata = split('-', $line['ATDT002DATA']);
	if ($isequencia==0)
		$sferiados = $adata[2] . '/' . $adata[1] . ' <input id=extop name=' . $isequencia . ' type=button value=excluir onclick="javascript:remover(document.getElementById(\'FERIADOS\'), document.forms[0].extop, this.name);" style="font-size: 10px;"><input type=hidden name=ATDT002DATA value="' . $line['ATDT002DATA'] . '"><BR>';
	else
		$sferiados .= '<OBJ>' . $adata[2] . '/' . $adata[1] . ' <input id=extop name=' . $isequencia . ' type=button value=excluir onclick="javascript:remover(document.getElementById(\'FERIADOS\'), document.forms[0].extop, this.name);" style="font-size: 10px;"><input type=hidden name=ATDT002DATA value="' . $line['ATDT002DATA'] . '"><BR>';
	$isequencia++;
    }
} else {
$sferiados = '';
}

//disconecta do banco de dados
disconecta();
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Fukuda Motor Center</title>
<link rel=stylesheet type=text/css href=../includes/style.css>
<script language=JavaScript type=text/javascript src=../includes/validaror.js></script>
<script language="JavaScript">
<!--
objVld=getValidator('dat');
objVld.setView(true);
objVld.addRule('ATSV001FUNCIONAMENTOINICIO','required','horário de funcionamento de');
objVld.addRule('ATSV001FUNCIONAMENTOINICIO','hora','horário de funcionamento de');
objVld.addRule('ATSV001FUNCIONAMENTOFINAL','required','do horário de funcionamento até');
objVld.addRule('ATSV001FUNCIONAMENTOFINAL','hora','do horário de funcionamento até');
objVld.addRule('ATSV001ALMOCOINICIO','required','horário de almoço de');
objVld.addRule('ATSV001ALMOCOINICIO','hora','horário de almoço de');
objVld.addRule('ATSV001ALMOCOFINAL','required','horário de almoço até');
objVld.addRule('ATSV001ALMOCOFINAL','hora','horário de almoço até');
objVld.addRule('ATNI001DURACAO','required','tempo médio de uma visita');
objVld.addRule('ATNI001DURACAO','integer','tempo médio de uma visita');
objVld.addRule('document.dat.ATNI001DURACAO.value>=10','externalFunction','tempo médio de uma visita', 'O tempo médio de uma visita deve ser maior ou igual à 10 min');
objVld.addRule('ATNI001INTERVALO','required','tempo de intervalo entre visitas');
objVld.addRule('ATNI001INTERVALO','integer','tempo de intervalo entre visitas');
objVld.addRule('ATNI001ANTECEDENCIA','required','marcar visita com antecedencia de');
objVld.addRule('ATNI001ANTECEDENCIA','integer','marcar visita com antecedencia de');
objVld.addRule('ATNI001LIMITEMES','required','permite marcar visitas com até');
objVld.addRule('ATNI001LIMITEMES','integer','permite marcar visitas com até');
objVld.addRule("(document.dat.ATSV001SABADOSINICIO.value!='' && document.dat.ATSV001SABADOSFINAL.value!='')||(document.dat.ATSV001SABADOSINICIO.value=='' && document.dat.ATSV001SABADOSFINAL.value=='')",'externalFunction','','Se sábado possuir horário inicial deve possuir horário final e vice e versa');
objVld.addRule("(document.dat.ATSV001DOMINGOSINICIO.value!='' && document.dat.ATSV001DOMINGOSFINAL.value!='')||(document.dat.ATSV001DOMINGOSINICIO.value=='' && document.dat.ATSV001DOMINGOSFINAL.value=='')",'externalFunction','','Se domingo possuir horário inicial deve possuir horário final e vice e versa');
objVld.addRule('ATSV001SABADOSINICIO','hora','horário de funcionamento aos sábados de');
objVld.addRule('ATSV001SABADOSFINAL','hora','do horário de funcionamento aos sábados até');
objVld.addRule('ATSV001DOMINGOSINICIO','hora','horário de funcionamento aos domingos de');
objVld.addRule('ATSV001DOMINGOSFINAL','hora','do horário de funcionamento aos domingos até');

function openPop(sUrl, sName, iWidth, iHeight, sFeatures) {
	sFeatures += ',width=' + iWidth + ',height=' + iHeight + ',top=' + (Math.round((screen.height - iHeight + 6)/2)) + ',left=' + (Math.round((screen.width - iWidth - 20)/2));
    window.open(sUrl,sName,sFeatures);
}

function executa(stipo, svalor){
	if(document.forms[0].ATBL001SABADOS.checked == false){
		document.forms[0].ATBL001SABADOS.value = 0;
		document.forms[0].ATBL001SABADOS.checked = true;
	}
	if(document.forms[0].ATBL001DOMINGOS.checked == false){
		document.forms[0].ATBL001DOMINGOS.value = 0;
		document.forms[0].ATBL001DOMINGOS.checked = true;
	}
	rename(document.forms[0].ATDT002DATA, 1);
	document.forms[0].exec.value=stipo;
	if (svalor!='') document.forms[0].values.value=svalor;
	document.forms[0].submit();
}

//Descrição: Exclui elementos
function remover(obj, objF, value){
	if (obj.innerHTML.search('<OBJ>')==-1)
		obj.innerHTML='';
	else {
		arrhtml = obj.innerHTML.split('<OBJ>')
		obj.innerHTML='';
		for (i=0; i<arrhtml.length; i++){
			if(i!=value){
				if(obj.innerHTML!='')
					obj.innerHTML=obj.innerHTML+'<OBJ>'+arrhtml[i];
				else
					obj.innerHTML=obj.innerHTML+arrhtml[i];
			}
		}
	}
	if (obj.innerHTML!='')
		obj.innerHTML=obj.innerHTML.replace('<BR><BR>', '<BR>');
	rename(objF, 0);
}

//Descrição: renomeia botões de exclusão
function rename(objF, itipo){
	if (objF){
			if (objF.length)
				for (i=0; i<objF.length; i++){
					if (itipo==0)
						objF[i].name=i;
					else
						objF[i].name=objF[i].name + '[' + i + ']';
				}
	}
}

//Descrição: Inclui elementos
function adiciona(){
	var datHoje = new Date();
	if (document.getElementById("dia").value.length==2 && 
	!isNaN(document.getElementById("dia").value) && 
	document.getElementById("dia").value!=00 && 
	document.getElementById("mes").value.length==2 && 
	!isNaN(document.getElementById("mes").value) && 
	document.getElementById("mes").value!=00 && 
	verifyDate(document.getElementById("dia").value + '/' + document.getElementById("mes").value + '/' + datHoje.getYear())){
		if (document.getElementById("FERIADOS").innerHTML=='')
			document.getElementById("FERIADOS").innerHTML=document.getElementById("FERIADOS").innerHTML.replace('<BR><BR>','<BR>') + document.getElementById("dia").value + '/' + document.getElementById("mes").value +' <input id=extop type=button value=excluir onclick=\"javascript:remover(document.getElementById(\'FERIADOS\'), document.forms[0].extop, this.name);\" style=\"font-size: 10px;\"><input type=hidden name=ATDT002DATA value=\"0001-' + document.getElementById("mes").value + '-' + document.getElementById("dia").value + '\"><BR>';
		else
			document.getElementById("FERIADOS").innerHTML=document.getElementById("FERIADOS").innerHTML.replace('<BR><BR>','<BR>') + '<OBJ>' + document.getElementById("dia").value + '/' + document.getElementById("mes").value +' <input id=extop type=button value=excluir onclick=\"javascript:remover(document.getElementById(\'FERIADOS\'), document.forms[0].extop, this.name);\" style=\"font-size: 10px;\"><input type=hidden name=ATDT002DATA value=\"0001-' + document.getElementById("mes").value + '-' + document.getElementById("dia").value + '\"><BR>';
		document.getElementById("mes").value='';
		document.getElementById("dia").value='';
		rename(document.forms[0].extop, 0);
	} else
		alert('Data inválida:\nformato dd/mm;');
}

//-->
</script>
</head>
<body leftmargin=0 topmargin=0 rightmargin=0 bottommargin=0 marginwidth=0 marginheight=0>
<table border=0 cellspacing=0 cellpadding=0 bgcolor="#000000" width="100%" height="100%">
<tr>
    <td colspan=4 height=32><img src=../images/gif.gif width=1 height=32></td>
</tr>
<tr>
    <td height=34><img src=../images/gif.gif width=1 height=34></td>
    <td width=181><a href="index1.php"><img src=../images/logo.gif width=181 height=34 border=0></a></td>
    <td width=546 align=right><?
require "menu.php";?></td>
    <td><img src=../images/gif.gif width=1 height=1></td>
</tr>
<tr>
    <td colspan=4 height=32><img src=../images/gif.gif width=1 height=32></td>
</tr>
<tr>
    <td height=50><img src=../images/gif.gif width=1 height=50></td>
    <td rowspan=3 colspan=2 width=727>
	<table width=727 height=87 cellspacing=0 cellpadding=0 border=0>
	<tr>
	    <td rowspan=3 width=6>
			<table cellspacing=0 cellpadding=0 border=0 width=6>
			<tr><td height=54><img src=../images/gif.gif width=6 height=1></td></tr>
			<tr><td height=1 bgcolor="#37749D"><img src=../images/gif.gif width=6 height=1></td></tr>
			<tr><td height=33 background=../images/sombra_esq.gif><img src=../images/gif.gif width=6 height=1></td></tr>
			</table>
		</td>
	    <td colspan=3 width=715 height=6 bgcolor=white><img src=../images/gif.gif width=1 height=6></td>
	    <td rowspan=3 width=6>
			<table cellspacing=0 cellpadding=0 border=0 width=6>
			<tr><td height=54><img src=../images/gif.gif width=6 height=1></td></tr>
			<tr><td height=1 bgcolor="#37749D"><img src=../images/gif.gif width=6 height=1></td></tr>
			<tr><td height=33 background=../images/sombra_dir.gif><img src=../images/gif.gif width=6 height=1></td></tr>
			</table>
		</td>
	</tr>
	<tr>
	    <td width=6 bgcolor=white><img src=../images/gif.gif width=6 height=1></td>
	    <td width=703 height=69>
			<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" WIDTH="703" HEIGHT="76">
				<PARAM NAME=movie VALUE="../swf/agende.swf">
				<PARAM NAME=loop VALUE=false>
				<PARAM NAME=menu VALUE=false>
				<PARAM NAME=quality VALUE=best>
				<PARAM NAME=bgcolor VALUE=black>
				<EMBED src="../swf/agende.swf" loop=false menu=false quality=best bgcolor=black  WIDTH="703" HEIGHT="76" TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer"></EMBED>
			</OBJECT>
		</td>
	    <td width=6 bgcolor=white><img src=../images/gif.gif width=6 height=1></td>
	</tr>
	<tr>
	    <td colspan=3 height=6 bgcolor=white><img src=../images/gif.gif width=1 height=6></td>
	</tr>
	<tr>
		<td width=6><img src=../images/c_esq.gif></td>
	    <td colspan=3 height=6 background=../images/sombra_mei_t.gif><img src=../images/gif.gif width=1 height=6></td>
	    <td width=6><img src=../images/c_dir.gif></td>
	</tr>
	</table>
</td>
    <td height=50><img src=../images/gif.gif width=1 height=50></td>
</tr>
<tr>
    <td height=1 bgcolor="#37749D"><img src=../images/gif.gif width=1 height=1></td>
    <td height=1 bgcolor="#37749D"><img src=../images/gif.gif width=1 height=1></td>
</tr>
<tr>
    <td bgcolor=white background=../images/bg.gif height=36><img src=../images/gif.gif width=1 height=36></td>
    <td bgcolor=white background=../images/bg.gif height=36><img src=../images/gif.gif width=1 height=36></td>
</tr>
<tr>
    <td colspan=4 height="100%" align=center valign=top bgcolor=white background=../images/bg.gif>
	<table width=727 cellspacing=0 cellpadding=0 border=0>
	<tr>
	    <td width=6><img src=../images/c_esq_b.gif></td>
	    <td colspan=3 width=715 background=../images/sombra_mei_b.gif><img src=../images/gif.gif width=1 height=5></td>
	    <td width=6><img src=../images/c_dir_b.gif></td>
	</tr>
	<tr>
	    <td rowspan=3 background=../images/sombra_esq.gif width=6><img src=../images/gif.gif width=6 height=1></td>
	    <td rowspan=3 bgcolor=white width=6><img src=../images/gif.gif width=6 height=1></td>
	    <td bgcolor=white height=6 width=703><img src=../images/gif.gif width=1 height=6></td>
	    <td rowspan=3 bgcolor=white width=6><img src=../images/gif.gif width=6 height=1></td>
	    <td rowspan=3 background=../images/sombra_dir.gif width=6><img src=../images/gif.gif width=6 height=1></td>
	</tr>
	<tr>
		<td background=../images/bg_gradativo.gif width=703>
			<table cellspacing=10 cellpadding=4 border=0>
			<tr>
			    <td valign=top width=178>
					<table cellspacing=0 cellpadding=0 border=0>
					<tr>
						<td colspan=5><img src=../images/tit_agenda.gif border=0></td>
					</tr>
					<tr>
						<td colspan=5><img src=../images/gif.gif width=1 height=3></td>
					</tr>
					<tr>
						<td rowspan=5 bgcolor="#919090"><img src=../images/gif.gif width=1 height=1></td>
						<td colspan=3 bgcolor="#919090"><img src=../images/gif.gif width=1 height=1></td>
						<td rowspan=5 bgcolor="#919090"><img src=../images/gif.gif width=1 height=1></td>
					</tr>
					<tr>
						<td rowspan=3 bgcolor="#ffffff"><img src=../images/gif.gif width=4 height=1></td>
						<td bgcolor="#ffffff"><img src=../images/gif.gif width=1 height=4></td>
						<td rowspan=3 bgcolor="#ffffff"><img src=../images/gif.gif width=4 height=1></td>
					</tr>
					<tr>
						<td width=168 bgcolor="#F0F0F0">
						<img src=../images/gif.gif width=1 height=15><a href='agenda_configurar.php' class=menu_text>:: configurar</a><br>
						<img src=../images/gif.gif width=1 height=15><a href='agenda_compromissos.php' class=menu_text>:: compromissos</a><br><img src=images/gif.gif width=1 height=8></td>
					</tr>
					<tr>
						<td bgcolor="#ffffff"><img src=../images/gif.gif width=1 height=4></td>
					</tr>
					<tr>
						<td colspan=3 bgcolor="#919090"><img src=../images/gif.gif width=1 height=1></td>
					</tr>
					</table>
				</td>
				<td><img src=../images/gif.gif width=1 height=1></td>
				<form action="<?=$_SERVER['SCRIPT_NAME']?>" name=dat method=post>
			    <td class=text_gray width=473>
					<table cellspacing=0 cellpadding=0 border=0>
					<tr>
						<td class=text_gray>horário de funcionamento:</td>
						<td><img src=../images/gif.gif width=10 height=1></td>
						<td class=text_gray>de <input type=text name=ATSV001FUNCIONAMENTOINICIO value="<?=$ATSV001FUNCIONAMENTOINICIO?>" class=form_contato style="width: 62;"> até <input type=text name=ATSV001FUNCIONAMENTOFINAL value="<?=$ATSV001FUNCIONAMENTOFINAL?>" class=form_contato style="width: 62;"></td>
					</tr>
					<tr>
						<td class=text_gray>horário de almoço:</td>
						<td><img src=../images/gif.gif width=10 height=1></td>
						<td class=text_gray>de <input type=text name=ATSV001ALMOCOINICIO value="<?=$ATSV001ALMOCOINICIO?>" class=form_contato style="width: 62;"> até <input type=text name=ATSV001ALMOCOFINAL value="<?=$ATSV001ALMOCOFINAL?>" class=form_contato style="width: 62;"></td>
					</tr>
					<tr>
						<td class=text_gray>tempo médio de uma visita:</td>
						<td><img src=../images/gif.gif width=10 height=1></td>
						<td class=text_gray><input type=text name=ATNI001DURACAO value="<?=$ATNI001DURACAO?>" class=form_contato style="width: 22;"> (minutos)</td>
					</tr>
					<tr>
						<td class=text_gray>tempo de intervalo entre visitas:</td>
						<td><img src=../images/gif.gif width=10 height=1></td>
						<td class=text_gray><input type=text name=ATNI001INTERVALO value="<?=$ATNI001INTERVALO?>" class=form_contato style="width: 22;"> (minutos)</td>
					</tr>
					<tr>
						<td class=text_gray>marcar visita com antecedencia de:</td>
						<td><img src=../images/gif.gif width=10 height=1></td>
						<td class=text_gray><input type=text name=ATNI001ANTECEDENCIA value="<?=$ATNI001ANTECEDENCIA?>" class=form_contato style="width: 22;"> (dias)</td>
					</tr>
					<tr>
						<td class=text_gray>permite marcar visitas com até:</td>
						<td><img src=../images/gif.gif width=10 height=1></td>
						<td class=text_gray><input type=text name=ATNI001LIMITEMES value="<?=$ATNI001LIMITEMES?>" class=form_contato style="width: 22;"> (meses)</td>
					</tr>

					<tr>
						<td class=text_gray><input type="checkbox" name=ATBL001SABADOS value="1"<?if($ATBL001SABADOS==1)echo " checked"?>> agenda visitas aos sábados:</td>
						<td><img src=../images/gif.gif width=10 height=1></td>
						<td class=text_gray>de <input type=text name=ATSV001SABADOSINICIO value="<?=$ATSV001SABADOSINICIO?>" class=form_contato style="width: 62;"> até <input type=text name=ATSV001SABADOSFINAL value="<?=$ATSV001SABADOSFINAL?>" class=form_contato style="width: 62;"></td>
					</tr>
					<tr>
						<td class=text_gray><input type="checkbox" name=ATBL001DOMINGOS value="1"<?if($ATBL001DOMINGOS==1)echo " checked"?>> agenda visitas aos domingos:</td>
						<td><img src=../images/gif.gif width=10 height=1></td>
						<td class=text_gray>de <input type=text name=ATSV001DOMINGOSINICIO value="<?=$ATSV001DOMINGOSINICIO?>" class=form_contato style="width: 62;"> até <input type=text name=ATSV001DOMINGOSFINAL value="<?=$ATSV001DOMINGOSFINAL?>" class=form_contato style="width: 62;"></td>
					</tr>
					</table><br>
					<table cellspacing="0" cellpadding="0" border="0">
					<tr>
						<td colspan=3 class=text_gray>Feriados que não agenda visita</td>
					</tr>
					<tr>
						<td class=text_gray valign=bottom>adicionar:</td>
						<td><img src=../images/gif.gif width=10 height=25></td>
						<td class=text_gray valign=bottom><input type=text name=dia class=form_contato style="width: 20;"> / <input type=text name=mes class=form_contato style="width: 20;"> <a href="javascript:adiciona()"><img src=../images/admin/incluir.gif alt=incluir border=0></a></td>
					</tr>
					<tr>
						<td colspan=2><img src=../images/gif.gif width=10 height=20></td>
						<td class=text_gray valign=bottom>
							<div id="FERIADOS" class=front_texto style="font-size: 12px; heigth: 82px; left: 200px; top: 50px; width: 300px;"><?=$sferiados?></div>
						</td>
					</tr>
					</table>
					<input type=hidden name=PKNI001ID value=1>
					<a href='#' onclick="javascript:if(!objVld_dat.execute()){openPop('../erro.php?e=' + strErrorMessage, 'erro', 328, 180, 'scrollbars=yes,resizable=no,location=no,toolbar=no,menubar=no,status=no')}else{executa('alt', '');};" class=text_gray style="text-decoration: underline;">gravar</a><br>
				</td>
				<input type=hidden name=exec onchange="alert(this.value);">
				</form>
			</tr>
			</table>
		</td>
	</tr>
	<tr>
		<td bgcolor=white height=6><img src=../images/gif.gif width=1 height=6></td>
	</tr>
	<tr>
	    <td><img src=../images/c_esq.gif></td>
	    <td colspan=3 background=../images/sombra_bai.gif height=6><img src=../images/gif.gif width=1 height=6></td>
	    <td><img src=../images/c_dir.gif></td>
	</tr>
	</table>
</td>
</tr>
</table>
<?=$salert?>
</body>
</html>

 

The full message error:

 

Erro de execução tipo "Warning" - 10/03/2012 12:16:20 Mensagem: "mysql_fetch_array() expects parameter 1 to be resource, boolean given" Arquivo: /home/www/fukudamotor.com.br/www/admin/agenda_configurar.php - linha: 58 Erro de execução tipo "Warning" - 10/03/2012 12:16:20 Mensagem: "mysql_fetch_array() expects parameter 1 to be resource, boolean given" Arquivo: /home/www/fukudamotor.com.br/www/admin/agenda_configurar.php - linha: 58 Erro de execução tipo "Warning" - 10/03/2012 12:16:20 Mensagem: "mysql_free_result() expects parameter 1 to be resource, boolean given" Arquivo: /home/www/fukudamotor.com.br/www/admin/agenda_configurar.php - linha: 64 Erro de execução tipo "Warning" - 10/03/2012 12:16:20 Mensagem: "mysql_fetch_array() expects parameter 1 to be resource, boolean given" Arquivo: /home/www/fukudamotor.com.br/www/admin/agenda_configurar.php - linha: 58 Erro de execução tipo "Warning" - 10/03/2012 12:16:20 Mensagem: "mysql_free_result() expects parameter 1 to be resource, boolean given" Arquivo: /home/www/fukudamotor.com.br/www/admin/agenda_configurar.php - linha: 64 Erro de execução tipo "Warning" - 10/03/2012 12:16:20 Mensagem: "mysql_fetch_array() expects parameter 1 to be resource, boolean given" Arquivo: /home/www/fukudamotor.com.br/www/admin/agenda_configurar.php - linha: 71 

 

Thanks

 

 

Link to comment
Share on other sites

This error:

 

Erro de execução tipo "Warning" - 10/03/2012 12:16:20 Mensagem: "mysql_fetch_array() expects parameter 1 to be resource, boolean given" Arquivo: /home/www/fukudamotor.com.br/www/admin/agenda_configurar.php - linha: 58 Erro de execução tipo "Warning" - 10/03/2012 12:16:20 Mensagem: "mysql_fetch_array() expects parameter 1 to be resource, boolean given" Arquivo: /home/www/fukudamotor.com.br/www/admin/agenda_configurar.php - linha: 58 Erro de execução tipo "Warning" - 10/03/2012 12:16:20 Mensagem: "mysql_free_result() expects parameter 1 to be resource, boolean given" Arquivo: /home/www/fukudamotor.com.br/www/admin/agenda_configurar.php - linha: 64 Erro de execução tipo "Warning" - 10/03/2012 12:16:20 Mensagem: "mysql_fetch_array() expects parameter 1 to be resource, boolean given" Arquivo: /home/www/fukudamotor.com.br/www/admin/agenda_configurar.php - linha: 58 Erro de execução tipo "Warning" - 10/03/2012 12:16:20 Mensagem: "mysql_free_result() expects parameter 1 to be resource, boolean given" Arquivo: /home/www/fukudamotor.com.br/www/admin/agenda_configurar.php - linha: 64 Erro de execução tipo "Warning" - 10/03/2012 12:16:20 Mensagem: "mysql_fetch_array() expects parameter 1 to be resource, boolean given" Arquivo: /home/www/fukudamotor.com.br/www/admin/agenda_configurar.php - linha: 71 

Link to comment
Share on other sites

Sorry:

 

line 58:

while ($alinha = mysql_fetch_array($config, MYSQL_ASSOC)) {
$bex = true;
foreach ($alinha as $id => $valor) {
	$$id = $valor;
}

line 64:

mysql_free_result($config);

line 71:

while ($line = mysql_fetch_array($datas, MYSQL_ASSOC)) {
        $adata = split('-', $line['ATDT002DATA']);
	if ($isequencia==0)
		$sferiados = $adata[2] . '/' . $adata[1] . ' <input id=extop name=' . $isequencia . ' type=button value=excluir onclick="javascript:remover(document.getElementById(\'FERIADOS\'), document.forms[0].extop, this.name);" style="font-size: 10px;"><input type=hidden name=ATDT002DATA value="' . $line['ATDT002DATA'] . '"><BR>';
	else
		$sferiados .= '<OBJ>' . $adata[2] . '/' . $adata[1] . ' <input id=extop name=' . $isequencia . ' type=button value=excluir onclick="javascript:remover(document.getElementById(\'FERIADOS\'), document.forms[0].extop, this.name);" style="font-size: 10px;"><input type=hidden name=ATDT002DATA value="' . $line['ATDT002DATA'] . '"><BR>';
	$isequencia++;
    }

Link to comment
Share on other sites

Sorry:

 

line 58:

while ($alinha = mysql_fetch_array($config, MYSQL_ASSOC)) {
$bex = true;
foreach ($alinha as $id => $valor) {
	$$id = $valor; // I am assuming this is line 58, as you have a syntax error here with two $
}

line 64:

mysql_free_result($config);

 

See my inline comment

Link to comment
Share on other sites

Echo mysql_error. See what error the db is kicking out. Also echo your query string and look it over.

 

This error:

 

Erro de execução tipo "Warning" - 10/03/2012 12:16:20 Mensagem: "mysql_fetch_array() expects parameter 1 to be resource, boolean given" Arquivo: /home/www/fukudamotor.com.br/www/admin/agenda_configurar.php - linha: 58 Erro de execução tipo "Warning" - 10/03/2012 12:16:20 Mensagem: "mysql_fetch_array() expects parameter 1 to be resource, boolean given" Arquivo: /home/www/fukudamotor.com.br/www/admin/agenda_configurar.php - linha: 58 Erro de execução tipo "Warning" - 10/03/2012 12:16:20 Mensagem: "mysql_free_result() expects parameter 1 to be resource, boolean given" Arquivo: /home/www/fukudamotor.com.br/www/admin/agenda_configurar.php - linha: 64 Erro de execução tipo "Warning" - 10/03/2012 12:16:20 Mensagem: "mysql_fetch_array() expects parameter 1 to be resource, boolean given" Arquivo: /home/www/fukudamotor.com.br/www/admin/agenda_configurar.php - linha: 58 Erro de execução tipo "Warning" - 10/03/2012 12:16:20 Mensagem: "mysql_free_result() expects parameter 1 to be resource, boolean given" Arquivo: /home/www/fukudamotor.com.br/www/admin/agenda_configurar.php - linha: 64 Erro de execução tipo "Warning" - 10/03/2012 12:16:20 Mensagem: "mysql_fetch_array() expects parameter 1 to be resource, boolean given" Arquivo: /home/www/fukudamotor.com.br/www/admin/agenda_configurar.php - linha: 71 

 

That is not the output from mysql_error, and it is not the result of echoing your query string.

Link to comment
Share on other sites

Your error will be coming from your MySQL query. When your query is successful it will return something called a resource id which is used by the mysql_fetch_array function.

 

If no resource id is returned by the query, the mysql_fetch_array function will fail which is what is happening in your case.

 

You need to refer to your query and ensure your t-SQL Is correct.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.