I'm trying to retrieve rows from a mysql table based on variables input by the user. Basically if use wants to search for "bob dilan" $fname and $lname would search and display all rows where this takes place, my connection to the user is fine as my $mysql_num_fields is working perfectly. Currently nothing works inside of my mysql_fetch_rows while loop, not even the echos, but there are no errors. I have even tried using the like operator instead of = to no avail.
PHP
$sql = "SELECT * FROM ".$tbl_name."
WHERE fname='".$fname."'
and lname='".$lname."'
and city='".$city."'
and phone='".$pohne."'
and interest_inet='".$internet."'
and interest_tv='".$television."'
and interest_voice='".$voice."'
and submission_ip='".$ip."'
and inquiry_handled='".$handled."'";
$result = mysql_query($sql);
echo "<table border='1'>";
echo "<tr>";
$i = 0;
while ($i < mysql_num_fields($result))
{
$meta = mysql_fetch_field($result, $i);
echo "<th>".$meta->name."</th>";
$i++;
}
while ($row = mysql_fetch_row($result))
{
echo '<tr>';
foreach($row as $item)
{
echo "<td>".$item."</td>";
}
echo '</tr>';
echo $row;
}
echo "</table>";