Hi! I’m learning PHP and I’ve been trying to experiment with variables in dealing with database.
I want to retrieve and display the content of the database input messages in this kind of URL. bpage.php?title=love&message=1
I would like the content to appear when I click at the title of the input message because it will be a link. And the URL would look something like this
bpage.php?title=love&message=1
My database table
no
name
title
message
date
here’s the code which I’ve tried to do it. The link is right but the content isn’t.
[url]http://positive0.negative0.net/pagepage.php?title=cheese&message=5
[code=php]
$result = mysql_query($query, $connect);
while ($info = mysql_fetch_array($result)) { //loops in retrieving data inputs
$nu = $info[‘no’];
$tl = “message”;
$bn = $info[‘title’]; //variable change
echo “<a href=”pagepage.php?title=”.$bn.”&”.$tl.”=”.$nu.””>”.$bn.”</a>”;
?>
<!–table border=”1″>
<tr><td>Title : <a href=”<?=$info[‘title’]?>”><?=$info[‘title’]?></a></td></tr>
<tr><td>Name : </td></tr>
<tr><td>Message : </td></tr>
</table–>
<br>
<?
}
MySql_close ($connect);
?>
thanks in advanced!