The query in the following returns the data I want when I provide value I want to find a match for, however, I seem to be having difficulty when returning the data using the echo statements at the end:
$conn = mysqli_connect($host,$username,$password, $database) or die (mysql_error ());
$searched=$_POST['searched'];
$sound = soundex($searched);
$sql = "SELECT * FROM word_list WHERE sound = '$sound';";
$result = mysql_query($conn,$sql);
while($row = mysql_fetch_array($result)) {
echo $row['word'] . ':' . $row['sound'] . '<br />';
}
mysqli_close($conn);
?>
The output in a browser is a blank page (no errors logged, etc.). When I var_dump the input, I get the correct soundex value; I am not sure where I've overlooked something, as seen above, tried a few things I saw in another thread.
'string(4) "A000"' is the result of the var_dump. As I explained, when I use 'A000' in place of my $sound variable, the query is successful in MySQL, and returns a list of words with matching soundex values (stored in a column called 'sound'), but I can't seem to get it to readout as such in the browser.