Note that there are some explanatory texts on larger screens.

plurals
  1. POCyrillic Characters RSS PHP MySQL
    primarykey
    data
    text
    <p>I'm trying to write a RSS feed for a website which mostly has Russian articles, though sometimes English. The site is built with php mysql. This is what the text looks like when I visit the url:</p> <blockquote> <p>Áåñåäà ¹1 èç öèêëà "Èçðàèëü è ìû"</p> </blockquote> <p>What am I doing wrong? Also, I'm tryn to add this line of code on top of the document but it breaks it and I get an error:</p> <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt; </code></pre> <p>Here is my php code excluding the database connect info. I'm desperate. Please help.</p> <pre><code>&lt;?php require_once ('cutils/db_connect.php3'); // PHP file that renders perfect Dynamic XML for MySQL Database result sets // Script written by Adam Khoury @ www.developphp.com - April 05, 2010 // View the video that is tied to this script for maximum understanding // ------------------------------------------------------------------- header("Content-Type: rss-http;"); //set the content type to xml // Initialize the xmlOutput variable $xmlBody = ' &lt;rss version="2.0"&gt; &lt;channel&gt; &lt;title&gt;Name of your site&lt;/title&gt; &lt;description&gt;A description of your site&lt;/description&gt; &lt;link&gt;http://yoururl.com/&lt;/link&gt; &lt;copyright&gt;Your copyright information&lt;/copyright&gt;'; // Connect to your MySQL database whatever way you like to here mysql_connect("localhost","dbuser","dbpass") or die (mysql_error()); mysql_select_db("sinaius2_em") or die ("no database"); // Execute the Query on the database to select items(20 in this example) $sql = mysql_query("SELECT `id`, `title`, `article_text`, `article_date` FROM `articles`ORDER BY `article_date` DESC LIMIT 0 , 15"); mysql_query("SET NAMES utf8"); while($row = mysql_fetch_array($sql)){ // Set DB variables into local variables for easier use $id = $row["id"]; $title = $row["title"] ; $date_time = strftime("%b %d, %Y", strtotime($row["article_date"])); $description = $row["article_text"]; // Start filling the $xmlBody variable with looping content here inside the while loop // It will loop through 20 items from the database and render into XML format $xmlBody .= " &lt;item&gt; &lt;title&gt;$title&lt;/title&gt; &lt;description&gt;TEST&lt;/description&gt; &lt;pubDate&gt;$date_time&lt;/pubDate&gt; &lt;link&gt;http://www.evreimir.com/article.php?id=$id&lt;/link&gt; &lt;/item&gt; "; } // End while loop mysql_close(); // close the mysql database connection_aborted $xmlBody .= "&lt;/channel&gt; &lt;/rss&gt;"; echo $xmlBody; // output the gallery data as XML file for flash ?&gt; </code></pre>
    singulars
    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.
    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