Hi,
Can anyone help me to get my query printed when I parse ID.
Here is the code:
[snip]
FILE: udskriv.php
<?php
include("connec t.php");
mysql_select_db ("DATABASE") ;
$result = mysql_query("SE LECT ID, tekst, DATE_FORMAT(dat o, '%d %m %Y
kl. %H:%i')as dato FROM TABLE ORDER BY ID desc LIMIT 0,3");
while ($raekke = mysql_fetch_arr ay($result)){
echo"<P>Indtast et dato: ".$raekke['dato']."</P>";
$text = $raekke['tekst'];
echo nl2br(substr($t ext,0,50));
print "<a href='showpost. php?ID={$raekke["ID"]}'>Some Text</a>";
}
mysql_close($li nk);
?>
FILE: showpost.php
<?php
include("connec t.php");
$ID = $_POST['ID'];
$sql = "SELECT tekst FROM TABLE WHERE ID=$ID";
$result = mysql_query($sq l);
echo "her er:".$result;
mysql_close($li nk);
?>
[snip]
The problem is that I don't get any output from the database. Why?
Ricki
Can anyone help me to get my query printed when I parse ID.
Here is the code:
[snip]
FILE: udskriv.php
<?php
include("connec t.php");
mysql_select_db ("DATABASE") ;
$result = mysql_query("SE LECT ID, tekst, DATE_FORMAT(dat o, '%d %m %Y
kl. %H:%i')as dato FROM TABLE ORDER BY ID desc LIMIT 0,3");
while ($raekke = mysql_fetch_arr ay($result)){
echo"<P>Indtast et dato: ".$raekke['dato']."</P>";
$text = $raekke['tekst'];
echo nl2br(substr($t ext,0,50));
print "<a href='showpost. php?ID={$raekke["ID"]}'>Some Text</a>";
}
mysql_close($li nk);
?>
FILE: showpost.php
<?php
include("connec t.php");
$ID = $_POST['ID'];
$sql = "SELECT tekst FROM TABLE WHERE ID=$ID";
$result = mysql_query($sq l);
echo "her er:".$result;
mysql_close($li nk);
?>
[snip]
The problem is that I don't get any output from the database. Why?
Ricki
Comment