• 0
Sign in to follow this  
Guest Now

Erro

Question

Guest Now

alguém sabe porque esta dando esse erro?

Notice: Undefined variable: sql in c:\arquivos de programas\apache\apache\htdocs\portalunai\guia_teste1\conexao.php on line 3

Share this post


Link to post
Share on other sites

3 answers to this question

Recommended Posts

  • 0

se voce puder postar seu código.....vai nos ajudar!!!

Share this post


Link to post
Share on other sites
  • 0
Guest Now
<?
$res1 = mysql_connect("localhost", "root","");
$res2 = mysql_db_query("portalunai", "$sql", $res1);
$res3 = mysql_db_query("portalunai", "$sql_01", $res1);
$res4 = mysql_db_query("portalunai", "$sql", $res1);
?>
      <?
$sql = mysql_query("SELECT * FROM catalago_categorias order by categoria") or die ('Falha na Query');
$cor = "#ffffff";
if(mysql_num_rows($sql)>0) {
while ($linha=mysql_fetch_array($sql)) {
$id = $linha["id"];
$categoria = $linha["categoria"];
if ($cor=="#ffffff"){
  $cor = "#eaeaea";
} else { 
  $cor="#ffffff";
}
echo "<table width='100%' border='0' cellspacing='0' cellpadding='0'align='center'>
<tr bgcolor=$cor> 
    <td height='18'><font size='1' face='Verdana'> 
      &nbsp;<a href=secao.php?categoria=$id>$categoria</a></font></td>
</tr>
</table>";
}
}
?>

Share this post


Link to post
Share on other sites

Join the conversation

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

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  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.

Sign in to follow this