我有两个表 rsales 和 salessumarry,我有这个 ff 值。
销售价值
date | receipt |
09/29/2103 | 112233 |
来自 rsales 的值
name | category | receipt |
33uf | capacitor | 112233 |
ic | ic22 | 112233 |
预期的输出一定是这样的。
date | receipt |
09/29/2103 | 112233 |
*name | category | receipt |*
33uf | capacitor | 112233 |
ic | ic22 | 112233 |
但我得到这样的结果,这是错误的。到目前为止,我的代码如下。
date | receipt |
09/29/2103 | 112233 |
*name | category | receipt |*
33uf | capacitor | 112233 |
*name | category | receipt |*
ic | ic22 | 112233 |
到目前为止我有这个ff代码
$a=$_POST['dayfrom'];
$b=$_POST['dayto'];
$result1 = mysql_query ("SELECT s.*, r.category, r.name,r.receipt
FROM salessumarry s
JOIN rsales r ON s.reciept = r.reciept
WHERE s.register_mode = 'sales'
AND s.date BETWEEN '$a' AND '$b' ");
while($row = mysql_fetch_array($result1))
{
echo '<tr>';
echo '<td style="border-color:#000000; border-style:solid; border-width:1px;"><div align="center">'.$row['date'].'</div></td>';
echo '<td style="border-color:#000000; border-style:solid; border-width:1px;"><div align="center">'.$row['reciept'].'</div></td>';
echo '</div></td>';
echo '</tr>';
echo '<th style="border-color:#000000; border-style:solid; border-width:1px;"><div align="center">'.$row['name'].'</div>
echo '<th style="border-color:#000000; border-style:solid; border-width:1px;"><div align="center">'.$row['category'].'</div></th>';
echo '<th style="border-color:#000000; border-style:solid; border-width:1px;"><div align="center">'.$row['receipt'].'</div></th>';
echo '<tr>';
echo '<th style="border-color:#000000; border-style:solid; border-width:1px;font-size:10px;background-image:url(images/buts3.png);color:white"">name</th>';
echo '<th style="border-color:#000000; border-style:solid; border-width:1px;font-size:10px;background-image:url(images/buts3.png);color:white"">category</th>';
echo '<th style="border-color:#000000; border-style:solid; border-width:1px;font-size:10px;background-image:url(images/buts3.png);color:white"">receipt</th>';
}
mysql_close($con);
?>