PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
I have a rss.php for my web site which fetch all articles from all catalog and works fine
BUT NOW I want NOT all articles from all catalog I want only catalog " my_catalog_1"
I want fetch all articles from " catalog 1 "
here is my rss.php now (which work fine fetch all articles)
=======================
<?php
include('connect.php');
$sql = "SELECT * FROM carbon_topics ORDER BY id DESC LIMIT 20";
$query = mysql_query($sql) or die(mysql_error());
header("Content-type: text/xml");
echo "<?xml version='1.0' encoding='UTF-8'?>
<rss version='2.0'>
<channel>
<title>9lessons | Programming Blog </title>
<link>http://example.com</link>
<description>Programming Blog </description>
<language>en-us</language>";
while($row = mysql_fetch_array($query))
{
$Topic=$row['Topic'];
$ID=$row['ID'];
echo "<item>
<title>$Topic</title>
<link>http://example.com/t/$ID</link>
</item>";
}
echo "</channel></rss>";
?>
=====================
here is my database (this database name is forum_catalog) this is the catalog it contains :" news , questions, help " and now I want only fetch articles from table(forum_catalog) =>news how to done that?
I don't have enough information to give you an example. You listed a table with no name and have told us nothing about carbon_topics, though we can see you are querying that also.
ok I M New to this and I do have a lot things to learn
I have a database named " onesixh3_bbs" and few tables and all the articles are stored in table " carbon_topics" as shown below http://bbs.168nyc.com/upload/image/2016 ... 548615.png
and another table called " carbon_tags" store all the tags as shown below
in this table it has three tags which are " news, questions, help"
NOW my question is how to create a rss feed that only fetch articles from table "carbon_tags" AND select from "news" only I dont want articles from other name
here is what I m thinking join this two tables and select from carbon_tags.news how to coding this ?
thank you so much really appreciate
In Table: carbon_topics.Tags has same value as table carbon_tags.name they store the same tag names
and in table carbon_posttags.TagID = carbon_tags.ID