Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Passing blog id variable from one page to another
Old 12-23-2009, 08:54 AM Passing blog id variable from one page to another
bswinnerton's Avatar
Skilled Talker

Posts: 57
Location: Montville, CT
Trades: 0
Okay, I'm sure I'm starting to annoy you guys by now

What I'm trying to do is make a link at the bottom of my blog entries (because they are going to be trimmed to the first, say 200 words and then if they go beyond that display a "read more" link. This link I want to end up looking something like: http://www.mysite.com/blog/index.php?id=xxx

And on that page, it will only display that one blog entry. How would I go about doing this?

Here is my current code for displaying the blog entries:

Code:
    <?php 
    mysql_connect($host,$user,$pass) or die("ERROR:".mysql_error());
    mysql_select_db($database) or die("ERROR DB:".mysql_error());
    $query = "SELECT * FROM blog WHERE categories LIKE '%Movies%' AND disclude_categories!=1 UNION SELECT * FROM news WHERE categories LIKE '%Movies%' AND disclude_categories!=1 UNION SELECT * FROM reviews WHERE categories LIKE '%Movies%' AND disclude_categories!=1 ORDER BY date DESC LIMIT 0,$movies_limit";
    $result = mysql_query($query) or die(mysql_error());
    while ($row = mysql_fetch_assoc($result)) {                                                                        /* while loop to return everything in the column */
      echo "<h2>",$row['title'],"</h2>","<p>","by: ",$row['author'],"</p>","<br />","<p>",$row['content'],"</p>";    /* return title, author and content and use css formatting */
      echo "<br /><br />";                                                                                            /* drop down a few lines after every post */
    }
    ?>
bswinnerton is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Reply     « Reply to Passing blog id variable from one page to another
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.23928 seconds with 12 queries