Code: Select all
<?php
@mysql_connect("www.website.com", "user", "pass") or die("could connect to server");
@mysql_select_db( "databaseName") or die("couldn't select db");
$query = mysql_query("select * from tableName where id='$_REQUESTїid]' ");
while ($row = mysql_fetch_array($query)) {
$pagetext1=$rowї"title"];
$pagetext=$rowї"content"];
$pagetext2=$rowї"link"];
}
echo "vartxt=<b>{$pagetext1}</b><br><br>{$pagetext}<br><br><b>{$pagetext2}";
?>What I need is a similar page which queries the database and gathers the text in the TITLE field and LINK field that have the same ID which is the variable passed by the prior link. And then displays them (echo) like this:vartxt=A bunch of text pulled from the database
And it should be a hyperlink. The text for the "Title 1" is pulled from the TITLE field while the URL for the hyperlink is pulled from the LINK field of that same record.title=Title 1
How would this code look? (using the code of the first page)