Hi ( and I'm sorry in advance ),
I have looked in php.net but I can't figure out how it's done.
I want to show a list of the three latest inserted posts in a mysql-table.
The list is meant to be an apertizer and the users have to click on it to
see the whole output from the DB.
How do I make the link to open that exact post?
Here is what is working for now:
<?php
$link = mysql_connect(" server", "user", "pass")
or die("Could not connect: " . mysql_error());
print ("Connected successfully");
mysql_select_db ("database") ;
$result = mysql_query("SE LECT ID, tekst, DATE_FORMAT(dat o, '%d %m %Y
kl. %H:%i')as dato FROM henriks ORDER BY ID desc LIMIT 0,3");
while ($raekke = mysql_fetch_arr ay($result)){
echo"<P> ID: ".$raekke['ID']."<br>";
$text = $raekke['tekst'];
echo"Tekst: ".nl2br(substr( $text,0,50)).". ...";
echo"<BR>Dato: ".$raekke['dato'];
}
?>
Regards Ricki
I have looked in php.net but I can't figure out how it's done.
I want to show a list of the three latest inserted posts in a mysql-table.
The list is meant to be an apertizer and the users have to click on it to
see the whole output from the DB.
How do I make the link to open that exact post?
Here is what is working for now:
<?php
$link = mysql_connect(" server", "user", "pass")
or die("Could not connect: " . mysql_error());
print ("Connected successfully");
mysql_select_db ("database") ;
$result = mysql_query("SE LECT ID, tekst, DATE_FORMAT(dat o, '%d %m %Y
kl. %H:%i')as dato FROM henriks ORDER BY ID desc LIMIT 0,3");
while ($raekke = mysql_fetch_arr ay($result)){
echo"<P> ID: ".$raekke['ID']."<br>";
$text = $raekke['tekst'];
echo"Tekst: ".nl2br(substr( $text,0,50)).". ...";
echo"<BR>Dato: ".$raekke['dato'];
}
?>
Regards Ricki
Comment