私は検索ボックスを作っていましたが、結果を数えたいのですが、数えようとしましたが、何も起こりません。
$con = mysql_connect("localhost","root","");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("concatenate", $con);
if($_POST['lname'] != '' or $_POST['fname'] != ''){
$searchq = $_POST['lname'];
$searchw = $_POST['fname'];
$result = mysql_query("SELECT * FROM sheet1
WHERE lname like '%$searchq%' AND fname like '%$searchw%' ");
結果を数えたいと思っていましたが、できません。
while($row = mysql_fetch_array($result))
{
echo "<tr>" .
"<td><b>" . $row['lname'] . "</b></td>" .
"<td>" . $row['fname'] . "</td>" .
"<td>" . $row['address'] . "</td>" .
"<td>" . $row['telnum'] . "</td>" .
"<td>" . $row['network'] . "</td>" .
"<td>" .
"<select class = \"report\">" .
"<option value = \"Wrong Number\" >" . 'Wrong Number' . "</option>" .
"<option value = \"Discontinue\">" . 'Discontinue' . "</option>" .
"<option value = \"Add Number\">" . 'Add Number' . "</option>" .
"<option value = \"Change Address\">" . 'Change Address' . "</option>" .
"</select>" .
"<input type = \"submit\" value= \"Report\" class= \"classname \" name= \"report\">" .
"</tr>";
}
}
みんな助けてください