hi all
i want to display news from other website and display them to my site using php & mysql.how to achive step wise???
hi all
i want to display news from other website and display them to my site using php & mysql.how to achive step wise???
A concise, practical plan for pulling news into a PHP + MySQL site, expanding on 's pointer to use feeds/APIs and tailoring it for someone starting from scratch ().
feeds table and an items table. Use the feed GUID (or a hash of the link+title) as a unique key to avoid duplicates. Store title, link, content, pubDate, fetched_at, and feed_id.Example skeleton (fetch + parse + insert):
$xml = simplexml_load_string(fetch($feedUrl)); // fetch() uses cURL
foreach ($xml->channel->item as $it) {
$guid = (string)($it->guid ?: md5((string)$it->link));
// check DB for guid; if missing, insert with prepared statement (PDO)
} Quick DB layout:
CREATE TABLE feeds (id INT AUTO_INCREMENT PRIMARY KEY, url VARCHAR(255));
CREATE TABLE items (id INT AUTO_INCREMENT PRIMARY KEY, feed_id INT, guid VARCHAR(255) UNIQUE, title VARCHAR(255), link VARCHAR(2083), content TEXT, pubDate DATETIME, fetched_at DATETIME); Notes: use prepared statements (PDO/mysqli), rate-limit requests, and respect copyright/attribution rules. If multiple feeds are needed, consider a mature feed library (eg. SimplePie) to save parsing edge cases.
Jump to Post— PoA 12It's called Aggregator. You can google "RSS Aggregator" or "PHP Aggregator"
It's called Aggregator. You can google "RSS Aggregator" or "PHP Aggregator"
It's called Aggregator. You can google "RSS Aggregator" or "PHP Aggregator"
hey dude ,
i have not much idea about php Aggregator.any other way to do this??
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.