Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Back End Short desc to full desc

  • This topic is empty.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #32947
    Kenny
    Member

    Hi all

    I’m quite new to php.

    I’m building a small site with php and mysql. I’ve a portfolio page that shows an image, title, short desc and read more link.
    What I want to do is when you click read more single.php will open and display the full post from the database.
    I have a post I’d in the db which I’m passing through the URL but cannot figure out what I need to do on single.php.

    Any help appreciated.

    Ken

    #74679
    ddliu
    Member

    Pass id to single.php and then in single.php


    ...//init and db connection

    $id=intval($_REQUEST);

    $query=mysql_query("SELECT * FROM posts WHERE id={$id}");
    $post=mysql_fetch_assoc($query);

    ...//show it
    #74605
    Kenny
    Member

    Thanks ddliu

    I spent three hours on this last night and nearly got to the “pull your hair out stage”.

    Now got it going in two minutes.

    Thanks again, ken

Viewing 3 posts - 1 through 3 (of 3 total)
  • The forum ‘Back End’ is closed to new topics and replies.