Re: RE:Please Help me!!!
| From: | Jacques Barker | Date: | Mon, 04 Dec 2000 07:32:20 +0000 |
| Subject: | Re: RE:Please Help me!!! | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-28537@lists.php.net to get a copy of this message | ||
Wouldn't a "nested" query using aliases work. i.e. "select * from table1 t1,
table2 t2 where t1.doc_no='$x' and t1.doc_rev='$y' and t1.status='$o'
and
t1.title_type='$b' and t2.status=$o and t2.a !='$doc[0]' order t2.$b";
I'm new to mysql myself but I think this is viable
Jacques
----- Original Message -----
From: "Wen Ni" <wnleong@mail.tke.po.my>
To: <php-general@lists.php.net>
Sent: Monday, December 04, 2000 8:49 AM
Subject: [PHP] RE:Please Help me!!!
> 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
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>
>
>