Jump to content

casperhollemans

New Members
  • Posts

    2
  • Joined

  • Last visited

Posts posted by casperhollemans

  1. Hello, my name is Casper.

     

    I'm createing a site where you can upload articles.

    But for now I onley can show 1 article on the pages.

    Does anyone knows how to show more articles?

     

    My script what posts 1 article:

     

     

     

    <?php

     

    $username = "";

    $db = "";

    $hostname = ""; 

    $password = "";

     

    @mysql_connect($hostname, $username, '') or die("connectie mislukt");

     

    @mysql_select_db("$db") or die ("could not connect dattabase");

     

    $sql = mysql_query('SELECT * FROM home ORDER BY Date') or die ('Database Error()');

     

    $id = 'ID';

    $date = 'Date';

    $title = 'Title';

    $article = 'Article';

     

    $rows = mysql_fetch_assoc($sql) or die ('Fetch Data Error()');

     

     

    echo $rows[$title], '-', $rows[$date];

    echo '</br>';

    echo '</br>';

    echo $rows[$article];

    ?>

     

    and here's a ss of my DB table:


     

    every article has to be in this order:

     

    title - date

     

    article

     

     

    thank you in advance,

     

    Casper Hollemans.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.