Any ideas on if and how I can use Mysqli and queries in combination with a PHP switch statement to populate textboxes based on which option of an HTML select box is currently selected? So far I have only been able to get a textbox populated on the initial page load ONLY, and this was ONLY through the default case of the PHP switch statement. My work so far is as follows:
$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;
}
echo '<html elements>';to shape your html page based off of your mysqli results. For example,if($row['isActive'] == 0) { echo '<b> isActive value is 0</b>'; } else { echo '<i>isActive value is 1</i>'; }