로 MYSQL_ASSOC()는 매개 변수 1 C에 주어진 자원 부울 것으로 예상가능한 중복 :
Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in경고 : XAMPP htdocs를 WR header.php 라인 18
나는이 코드를 가지고있다.
<?//index.php
if(!defined('INCLUDE_CHECK')) die('You are not allowed to execute this file directly');
include('db.php');//include our database
//connecting to the database
$con = mysql_connect($dbhost, $dbusername, $dbpassword);
//if we cant connect
if (!$con)
{
die ('could not connect to the database' . mysql_error());
}
//if successfully connected then select db
mysql_select_db ($dbtable, $con);
//our query
$result = mysql_query("SELECT * FROM header");
//fetch our result
while($row = mysql_fetch_array($result)) //this is the line 18
{
//if type is meta then..
if ($row['type'] === "meta")
{
$meta .= "<meta name='".$row['name']."' content='".$row['content']."' />";
}
//if type is title then..
elseif ($row['type'] === "title")
{
$title = "<title>".$row['content']."</title>";
$title2 = "<div id='ti'>".$row['name']."</div>";
}
//if type is favicon then..
elseif ($row['type'] === "favicon")
{
$favicon = "<link rel='shortcut icon' href='".$row['content']."' />";
$imglogo = "<img class='imglogo' src='".$row['content']."' />";
}
//if type is description then..
elseif ($row['type'] === "description")
{
$des = "<div id='ti2'>".$row['content']."</div>";
}
}
mysql_close($con);
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<? echo $title; //line 50 ?>
<? echo $favicon; //line 51 ?>
<? echo $meta; //line 52 ?>
<? echo (file_get_contents("cc.txt")); ?>
</head>
내가이 다음과 같은 오류를 가지고는, 경고 : \ XAMPP \ htdocs를 \ WR \ header.php 라인 (18)
주의 사항 :로 MYSQL_ASSOC()는 매개 변수 (1) C에 주어진 자원, 부울 될 것으로 예상 : 정의되지 않은 변수 : C의 제목 : \ XAMPP \ htdocs를 \ WR \ header.php 라인 50
공지 : 정의되지 않은 변수 : C에서 파비콘 : 라인 51 \ XAMPP \ htdocs를 \ WR \ header.php
알림 : 정의되지 않은 변수 : C : \ xampp \ htdocs \ wr \ header.php의 메타 line 52
오류 선은 코드를 따라 지정됩니다. 오류 선의 맨 위 코드를 참조하십시오.
나를 도울 수 있습니까? 미리 감사드립니다.
줄리버.
당신의 대답은 내 문제를 해결합니다. 당신에게 엄지 손가락을주었습니다. – youngdero