我试图在我的数据库中创建一个标题列表,并创建数据库中每个条目的可点击链接。一个错误是说数据库中没有标题,但我有很多标题。我希望用户可以根据他们按下的链接重定向到不同的页面
任何帮助??
require('connection.php');
mysql_select_db('trackdb');
//Run the query which selects the column link from table table, if there is an error, kill the
//program and display it.
$query = mysql_query("SELECT * FROM tracks WHERE id='".$_GET['id']."'") or die("Error:
".mysql_error()."!");
//Check if any results were returned
if(mysql_num_rows($query)>0){
//If so, display itresults
$row = mysql_fetch_array($query);
//Display the info
echo"$row[track_title]<br>
//If it no results were found...
}else{
//Tell them
echo"No titles found";
}
?>