我有一个 PHP Switch 机箱。如何使用按钮的 onclick 转换“n”的值?
switch (n)
{
case 1:
$result = mysql_query("select * from tblRestaurants order by RestName ASC");
break;
case 2:
$result = mysql_query("select * from tblCuisines order by RestName ASC");
break;
case 3:
$result = mysql_query("select * from tblLocations order by RestName ASC");
break;
case 4:
$result = mysql_query("select * from tblLocations order by RestName ASC");
break;
case 5:
$result = mysql_query("select * from tblLocations order by RestName ASC");
break;
}
onclick = (switch)n=1
只是猜测