关于是否以及如何将 Mysqli 和查询与 PHP switch 语句结合使用以根据当前选择的 HTML 选择框的哪个选项来填充文本框的任何想法?到目前为止,我只能在初始页面加载时填充一个文本框,这只是通过 PHP switch 语句的默认情况。到目前为止,我的工作如下:
$mysql = new mysqli($db_host, $db_username, $db_password, $db_name)
switch("Not sure what to put here")
{
case "corresponds with first <option> of select box but not sure how to do this" :
$result = $mysql->query(---placeholder for SQL query---);
while ($row = $result->fetch_object())
{
$queryResult = $row->---placeholder for column name---;
}
$textboxValue = $queryResult;
break;
}