我已經搜索了很多網站,但是我找不到如何從我用mysql創建的查詢創建鏈接。在從mysql查詢中創建鏈接
我希望當有人點擊coureurname他/她被重定向到另一個頁面,但我如何使這些查詢結果點擊能夠鏈接。我在下面用php代碼發佈了我的查詢,我希望你們能幫助我,因爲我真的不知道該怎麼做。
<html>
<title> lijstcoureur</title>
<head>
<H1> LIJST VAN COUREURS </H1>
</head>
<?php
$con=mysql_connect('localhost','root','****')
or die ('Kan geen verbinding maken met mySQL server');
$db=mysql_select_db('formule1',$con)
or die ('Kan de database niet selecteren');
$selectie=mysql_query("CALL lijstcoureurs()",$con);
if(!selectie)
die('Invalid query:'.mysql_error());
?>
<table border =1>
<thead>
<tr>
<?php
for($fieldindex=0;$fieldindex<mysql_num_fields($selectie);$fieldindex++)
{
echo '<th>';
echo mysql_field_name($selectie,$fieldindex);
echo '</th>';
}
?>
</tr>
</thead>
<tbody>
<?php
/*
Loop alle rijen langs en sla het resultaat op in variable $row */
while($row=mysql_fetch_array($selectie))
{
// Begin een nieuwe rij
echo('<tr>');
// Loop alle rijen langs en zet de inhoud in de tabel
for($fieldindex=0;$fieldindex<mysql_num_fields($selectie);$fieldindex++)
{
echo('<td>');
echo($row[$fieldindex]);
echo('</td>');
}
echo('</tr>');
}
?>
</tbody>
</table>
</body>
</html>
'mysql_ *'函數將[在PHP 5.5中棄用](http://php.net/manual/en/faq.databases.php#faq.databases.mysql.deprecated)。不建議編寫新代碼,因爲它將來會被刪除。相反,無論是[MySQLi](http://php.net/manual/en/book.mysqli.php)還是[PDO](http://php.net/manual/en/book.pdo.php)和[是一個更好的PHP開發人員](http://jason.pureconcepts.net/2012/08/better-php-developer/)。 –