RE:Please Help me!!!
| From: | Wen Ni | Date: | Mon, 04 Dec 2000 06:49:56 +0000 |
| Subject: | RE:Please Help me!!! | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-28536@lists.php.net to get a copy of this message | ||
Hi,
I have some problem with my SQL queries. Maybe this problem is quite
easy for you all but I'm still not familiar with PHP so I hope you all
can help me. I need it quite urgently to solve my company program.
I am writing PHP3 with MYSQL. I need to query multiple data from one
table to compare them with other table.
For example I need to select data a,b,c,d from table 1 and then compare
with data in table 2. If these data are matching with table 2, then I
don't want to display them. I only want to display the one which are
not match.
here is my error coding:
$count=0;
$query1 ="select doc from table1 where doc_no='$x' and doc_rev='$y' and
status='$o' and title_type='$b' ";
$result1 = mysql_query($query1,$db);
while($doc = mysql_fetch_row($result1))
{
$query = "select $a,$b,$c,$d from table 2 where status=$o and a
!='$doc[0]' order $b";
$result1 = mysql_query($query,$db);
while($data = mysql_fetch_row($result1))
{
print "data=$data[0]<br>\n";
}
$count++;
}
Can you help me to correct them? I can't make only unmatched data to
display on the form because they are while looping.
so please help me.
thanks a lot.
from Wendy