Note that there are some explanatory texts on larger screens.

plurals
  1. POPHP RSS not parsing at line 55
    primarykey
    data
    text
    <p>Hi I wonder if anyone can help with this code. I am trying to show the records from a URL table for a category, eg url_category_id = to 1. where the url and category is the same in the associating table. I am having some issues with this rss as it has a parse error on line 55. I have tried to resolve the issue but without avail.</p> <pre><code> &lt;?php $db = new mysqli("Host", "USER", "PW", "DB");?&gt; &lt;?php header('Content-type: text/xml'); ?&gt; &lt;?php echo "&lt;?";?&gt;xml version="1.0" encoding="iso-8859-1"&lt;?php echo "?&gt;";?&gt; &lt;rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"&gt; &lt;channel&gt; &lt;title&gt;My TITLE&lt;/title&gt; &lt;description&gt;My DESCRIPTION&lt;/description&gt; &lt;link&gt;www.MyWeb&lt;/link&gt; &lt;copyright&gt;C) 2009 All Rights Reserved&lt;/copyright&gt; &lt;atom:link href="http://source of feed" rel="self" type="application/rss+xml" /&gt; &lt;?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 &gt; 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-&gt;num_rows; for ($i = 1; $i &lt;= $number; $i++) { $row = $results-&gt;fetch_assoc(); $title = $row['title']; $description = $row['description']; $url = $row['url']; $date = $row['sortdate']; ?&gt; &lt;item&gt; &lt;title&gt;&lt;?php echo $title; ?&gt;&lt;/title&gt; &lt;description&gt;&lt;?php echo $description; ?&gt;&lt;/description&gt; &lt;link&gt;&lt;?php echo "http://";?&gt;&lt;?php echo $url; ?&gt;&lt;/link&gt; &lt;guid&gt;&lt;?php echo "http://";?&gt;&lt;?php echo $url; ?&gt;&lt;/guid&gt; &lt;pubDate&gt;&lt;?php echo date("D, d M Y H:i:s O", strtotime($date)); ?&gt;&lt;/pubDate&gt; &lt;/item&gt; &lt;?php } ?&gt; &lt;/channel&gt; &lt;/rss&gt; &lt;?php $db-&gt;close(); ?&gt;//This is the parse error line </code></pre> <p>I would be grateful for any assistance in trying to resolve this issue.</p> <hr> <p>All I am receiving is parse error on line 52 and if I alter it I get parse error on line 55 .. no reason as to the error, but I have noticed the code section isn't recognising it as php in this post. Sorry I can't offer anything further.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload