吨 我有关于一个匹配所选id的频段的数据,然后我使用band_id并让它在其他地方使用它。 我想对Name字段做同样的事情,但是我遇到了一些问题,它只是将word数组放入var $ name。
码
<?php
require 'core/init.php';
$Band_id = $_GET['id'];
$name = ['Name']; // trying to get the band name
$result = mysql_query("SELECT * FROM bands WHERE Band_id = $Band_id");
echo "<table border = '1'>
<tr>
<th>Band Name</th>
<th>Venue</th>
<th>Category</th>
<th>Stock</th>
<th>Buy Ticket</th>
</tr>";
while($row = mysql_fetch_array($result))
{
echo "<tr><form name=\"myform\" action=\" order.php\" method=\"post\">";
echo " <input name=\"band\" type=\"hidden\" value=\"". $Band_id."\" >";
echo " <input name=\"bandn\" type=\"hidden\" value=\"". $name."\" >";
echo "<td>" .$row['Name']. "</td>";
echo "<td>" .$row['Venue']. "</td>";
echo "<td>" .$row['Category']. "</td>";
echo "<td>" .$row['Stock']. "</td>";
echo "<td><button>Buy Ticket</button></td>";
echo "</tr> </form>";
}
echo "</table>";
&GT;
答案 0 :(得分:0)
$name = ['Name']
不会在查询之上工作,并且通常根本无法正常工作,因为它是您尝试执行的操作的无效语法。您曾使用$name
使用$row['Name']