我正在尝试从用户那里获取输入,然后从表中提取数据并显示它。
我的代码是
$ini = $_GET["ini_id"];
$con=mysqli_connect("localhost","root","","globalgoals");
// Check connection
if (mysqli_connect_errno())
{
echo "Failed to connect to MySQL: " . mysqli_connect_error();
}
else
{
$country = array();
//country
$sql="";
//!mysqli_query($con,$sql))
$result = mysqli_query($con,"SELECT * FROM country WHERE metrics="$ini");/*table name*/
while($row = mysqli_fetch_array($result))
{
array_push($country,$row['country']);/*column name*/
}
//
当我输入网址时http://localhost/xampp/testing/Int/table.php?ini=C2C
我得到错误
Notice: Undefined index: ini_id in C:\xampp\htdocs\xampp\Testing\Int\table.php on line 2