안녕하세요 누구든지이 코드를 도울 수 있는지 궁금합니다. url_category_id = 1과 같이 카테고리의 URL 테이블에서 레코드를 표시하려고합니다. URL과 카테고리가 연결 테이블에서 동일한 위치입니다. 55 번째 줄에 구문 분석 오류가 있기 때문에이 rss에 몇 가지 문제가 있습니다.이 문제를 해결하기 위해 노력했지만 유용하지는 않습니다.PHP 55 행에서 구문 분석하지 않는 RSS
<?php $db = new mysqli("Host", "USER", "PW", "DB");?>
<?php header('Content-type: text/xml'); ?>
<?php echo "<?";?>xml version="1.0" encoding="iso-8859-1"<?php echo "?>";?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
<title>My TITLE</title>
<description>My DESCRIPTION</description>
<link>www.MyWeb</link>
<copyright>C) 2009 All Rights Reserved</copyright>
<atom:link href="http://source of feed" rel="self" type="application/rss+xml" />
<?php
$query = 'SELECT * FROM url_categories WHERE url_category_id= $type';
$result = mysql_query ($query);
if (isset($_GET['type'])) {
$type = (int) $_GET['type'];
} else {
$type = 3;
}
if ($type > 0) {
// Get the current type name.
$query = "SELECT category FROM url_categories WHERE url_category_id=$type";
$result = mysql_query ($query);
list ($category) = mysql_fetch_array ($result, MYSQL_NUM);
$first = TRUE; // Initialize the variable.
// Query the database.
$query = "SELECT u.url_id, url, title, description, pub_date, STR_TO_DATE(pub_date, '%d-%b-%Y') AS sortdate, DATE_FORMAT(STR_TO_DATE(pub_date, '%d-%b-%Y'), '%d.%b.%Y') FROM urls AS u, url_associations AS ua WHERE u.url_id = ua.url_id AND ua.url_category_id=$type AND ua.approved = 'Y'ORDER BY sortdate DESC";
$result = mysql_query ($query);
$num_records = mysql_num_rows($result);
$number = $results->num_rows;
for ($i = 1; $i <= $number; $i++) {
$row = $results->fetch_assoc();
$title = $row['title'];
$description = $row['description'];
$url = $row['url'];
$date = $row['sortdate'];
?>
<item>
<title><?php echo $title; ?></title>
<description><?php echo $description; ?></description>
<link><?php echo "http://";?><?php echo $url; ?></link>
<guid><?php echo "http://";?><?php echo $url; ?></guid>
<pubDate><?php echo date("D, d M Y H:i:s O", strtotime($date)); ?></pubDate>
</item>
<?php
}
?>
</channel>
</rss>
<?php
$db->close();
?>//This is the parse error line
이 문제를 해결하는 데 도움을 주셔서 감사합니다.
내가 수신하고 모든
라인 (52)에 구문 분석 오류를 내가 그것을 변경하는 경우 I 라인 55에 구문 분석 오류가 .. 오류에 관해서는 아무 이유없이,하지만 난 코드 섹션이 그것을 인식하지 못합니다 발견했습니다 이 게시물에 PHP로. 죄송합니다. 더 이상 제공 할 수 없습니다.
그래, 오류가 좋을 것입니다. :) – Christian