我对根据搜索表格显示“访问”表的结果有问题!
这里是法典!
<?php
$date1 = $_POST[ day ] . "-" . $_POST[ month ] . "-" . $_POST[ year ];
$date2 = $_POST[ day1 ] . "-" . $_POST[ month1 ] . "-" . $_POST[ year1 ];
$product=$_POST[ product ];
$region=$_POST[ region ];
$speciality=$_POST[ speciality ];
$type=$_POST[ visit_type ];
$query="SELECT id, name, seller_1_name, seller_2_name FROM visits Where (speciality = $speciality ) AND (type = $type ) AND (product = $product ) AND (date BETWEEN $date1 AND $date2 )";
$num=mysql_numrows($result);
$row = mysql_fetch_array($result);
?>
<h3> Showing results where Product is <?php echo $product; ?>, Speciality is <?php echo $speciality ?>, Region is <?php echo $region ?> and Type is <?php echo $type ?>.</h3>
<table class="auto-style4" style="width: 100%" border="1"><tr>
<td style="height: 18px">ID</td>
<td style="height: 18px">Name</td>
<td style="height: 18px">seller one name</td>
<td style="height: 18px">seller 2 name</td>
</tr>
<tr>
<?php
$i=0;
while ($i < $num) {
$f1=mysql_result($result,$i,"id");
$f2=mysql_result($result,$i,"name");
$f4=mysql_result($result,$i,"seller_1_name");
$f5=mysql_result($result,$i,"seller_2_name");
?>
<td><?php echo $f1; ?> </td>
<td><?php echo $f2; ?> </td>
<td><?php echo $f4; ?></td>
<td><?php echo $f5; ?></td>
</tr>
<?php
$i++;
}
?>
该表以正确的变量显示标题,但表中的错误代码为:
警告:我的sql_numrows(以英语发言):所提供的论据不是MySQL在175条线上产生/home/ebarea/public_html/.../.../results_submitt.php的有效结果资源
警告:我的sql_fetch_array():所提供的论据不是M.SQL在M.SQL第176条线上提供的资源。
妇女权利行动组织