I'm trying to pull data from the mysql database & display the result in a form. In the mysql databse the databse name is flow. The table the names are listed in is named clerk_names & the only fields in thei table is names & clerk_id. When I put the below code in a form & display it in a browser, in the Assign To: field the value shows <?=$randomName?> instead of the result from the query...have I mistyped something? Thanks again for any help or assistance provided.
PHP Code:
<?php
$mysqli = new mysqli('localhost', 'myusername', 'mypassword', 'flow');
$sql = "SELECT names FROM clerk_names ORDER BY RAND() LIMIT 1";
$res = $mysqli->query($sql);
$row = $res->fetch_row();
$randomName = $row[0];
$res->free();
?>
<td><b>Assign To:</b> <br><input type="text" name="clerk_names" size="15" maxlength="30" value="<?=$randomName?>" /><br /> </td>