Forum Moderators: open

Message Too Old, No Replies

Displaying a DB item from an RSS link

         

cookie2

12:41 am on Oct 28, 2006 (gmt 0)

10+ Year Member



MySQL is not my strong suit. ;) I'm trying to set up an RSS feed where each item would be directed to another page for more information to be displayed. The additional information would be extracted from the database table and be displayed dynamically on a new page. But I can't seem to get the right phrasing.

I'm using this format - http#//www.mydomain.com/rssdisplay.htm#24 - as the link that forwards to the new page called rssdisplay.htm. What I need to do is pull ID# 24 (or whatever other one is requested) from the table and display it. But I can't come up with how.

I thought this would work:
$referer = $_SERVER['HTTP_REFERER'];
$ids = explode("#", $referer);
$ids = $ids;

$select = "SELECT * FROM `news` WHERE `ID` LIKE $ids";

but it doesn't. :( What am I doing wrong here? Can anyone point me in the right direction?

[1][edited by: txbakers at 2:05 am (utc) on Oct. 28, 2006]
[edit reason] de-activated sample link. [/edit]

ahmedtheking

12:04 am on Oct 30, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Right, PHP I guess? There's things call 'global vars'. By default, PHP doesn't (register global vars). What this means is that if you have var id in the URL then you need to use $_GET['id'] instead of $id! Read more here: [uk.php.net...]