You can only use variables inside of string while using double quotes
This will work:
echo "Hello world $variable";
While this will not:
echo 'Hello world $variable';
I can see, however, that it may be an issue because there's double quotes in the HTML, this leaves you with a few options.
Option 1
Use double quotes to encase the string, and then escape the existing double quotes:
echo "<input name=\"$criteria_name\" type=\"textbox\"/> <br/><br/>";
Option 2
Concatenate the strings:
echo '<input name="' . $row['criteria_name'] . '" type="textbox"/> <br/><br/>';
Option 3
Use the alternative syntax for the control structures, and use raw HTML:
if ($result->num_rows > 0):
while($row = $result->fetch_assoc()):
?>
<?= $row["criteria_name"]; ?>
<input name="<?= $criteria_name; ?>" type="textbox"/><br/><br/>
<?php
endwhile;
endif;
'; – nas May 16 '17 at 00:53