更具体地说,我收到:
*注意:第 38 行 C:\xampp\htdocs\Project1_Tables\index.php 中的数组到字符串转换 注意:第 39 行 C:\xampp\htdocs\Project1_Tables\index.php 中的数组到字符串转换*
这是代码
<?php
//SETUP FOR CONNECTION
$host = "localhost";
$user = "root";
$password = "password";
$database = "test";
$con = mysqli_connect($host, $user, $password, $database);
$tableName = "funding";
$sql = "";
//QUERIES NEEDED TO GATHER DATA FOR DROP-DOWN MENU'S (Research Theme and Institution)
$column = "research_theme";
$query = sprintf("SELECT DISTINCT %s FROM ", $column);
$sql = $query.$tableName;
$ddThemeList = mysqli_query($con, $sql);
$column = "institution";
$query = sprintf("SELECT DISTINCT %s FROM ", $column);
$sql = $query.$tableName;
$ddInstitutionList = mysqli_query($con, $sql);
$list1 = mysqli_fetch_array($ddThemeList, MYSQLI_NUM);
$list2 = mysqli_fetch_array($ddInstitutionList, MYSQLI_NUM);
require_once("support.php");
$body="";
$scriptName = $_SERVER["PHP_SELF"];
$topPart = <<<EOBODY
<form action="$scriptName" method="post">
<p>
Theme
<select name="theme">
<?php if(mysqli_num_rows($list1) != 0) { ?>
<?php while ($list1) { ?>
<option value="<?php echo $list1[0]; ?>">
<?php echo $list1[0]; ?>
</option>
<?php } ?>
<?php } ?>
</select>
</p>
</form>
EOBODY;
$body = $topPart.$body;
$page = generatePage($body);
echo $page;
?>