我有一個連接到我的數據庫並返回結果的名稱和價格的PHP腳本,但是,現在我正在嘗試創建一個鏈接 - 打開一個新的PHP頁面「more_info .php「並顯示與正確名稱對應的正確描述。鏈接到新頁面時顯示MySQL數據
我一直在努力做到這一點,但我一直未能得到它的工作。
while($row = mysqli_fetch_array($result)) //mysql_fetch_array bring back an object, in this case the $result of the mysql query and puts it into a variable $row
{
echo "<td align='center'>" . $row['name'] . "</td> <td align='center'> <input type='button' value='More Info'; onclick=\"window.location='?start=' . $row['name.description'] . ?more_info.php?';\"> </td>";
內的onclick
,我想在新窗口中打開,並把該名稱匹配的描述,到more_info.php
我輸入的代碼,但顯然它不是加工。這看起來像我在正確的道路上呢?
爲什麼在window.location有這麼多的問號?我想你想要window.location = more_info.php?start =「。$ row ['name.description'] 此外 - 會使用彈出更有意義嗎? –
我把它都搞砸了......:/ – ValleyDigital
一般格式是:index.php?name = Aaron&lastname = Kreider –