gpt4 book ai didi

javascript - 我需要明智地过滤数据 id 吗?

转载 作者:行者123 更新时间:2023-11-30 00:56:29 25 4
gpt4 key购买 nike

我需要按部件(车辆)的 ID 方式过滤数据,但它会获取与之相关的所有结果,而不是按客户方式(即 PID)。我的代码是我哪里出错了?

    <?php 
$sql="SELECT DISTINCT(PARTNO) FROM `paidamount` ORDER BY `PARTNO`";
$res=mysql_query($sql);
$num=mysql_num_rows($res);
if($num>0)
{
while($fetch=mysql_fetch_array($res))
{

?>
<tr>
<td colspan="15" align="left" style="background-color:#006699;"><p style=" color:#FFFFFF;"><strong><?php echo $fetch['PARTNO']?></strong></p></td>
</tr>


<?php

$sql="SELECT * FROM paidamount where paidamount.PARTNO='".$fetch['PARTNO']."' ORDER BY PARTNO";

//$sql="SELECT * FROM `paidamount`";
$result=mysql_query($sql);
$numrow=mysql_num_rows($result);

$i=1;
while($rows=mysql_fetch_array($result))
{
//echo $rows['id'];
$imid=explode(",",$rows['issued_med']);
$pmid=explode(",",$rows['ffffff']);

?>

最佳答案

替换

 $sql="SELECT DISTINCT(PARTNO) FROM `paidamount` ORDER BY `PARTNO`";

此查询与以下查询:-

 $sql="SELECT DISTINCT(PARTNO) as PARTNO FROM `paidamount` ORDER BY `PARTNO`";

关于javascript - 我需要明智地过滤数据 id 吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20512196/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com