[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: JOIN NOT WORKING!!
I gave your suggestion a try and it still did not produce a result. At
least one record should have been returned. I have included the new code,
maybe someone out there has an idea or two.
my $subcat=$fields{'subcategory'};
$sth = $dbh->prepare("SELECT Categories.Category_Name FROM
Categories,SubCategories WHERE
Categories.Category_Index=SubCategories.Category_Index AND
SubCategory_Name=$subcat");
$sth->execute();
while (@data = $sth->fetchrow_array()) {
my $Category_Name = $data[0];
$Category_Name=~tr/ /+/;
print "<tr><td><font color=blue>Category:</td><td>$data[0]</td></tr>\n";
}
----- Original Message -----
From: "Gerald L. Clark" <gerald_clark@xxxxxxxxxxxxxxxxxxx>
To: "Mike Podlesny" <m.podlesny@xxxxxxxxxx>
Cc: "mySQL Mailing List" <mysql@xxxxxxxxxxxxxxx>
Sent: Tuesday, January 02, 2001 10:03 AM
Subject: Re: JOIN NOT WORKING!!
> Mike Podlesny wrote:
> >
> > The following statement is not returning any results even though it
should
> > return 1 record. I am trying to join a table called Categories with a
table
> > called SubCategories on the appropriate indexes where a certain
subcategory
> > was selected.
> >
>
> my $subcat=$fields{'subcategory'};
>
> > $sth = $dbh->prepare("SELECT Categories.Category_Name FROM Categories,
> > SubCategories WHERE
Categories.Category_Index=SubCategories.Category_Index
> AND SubCategory_Name=$subcat");
>
> #> AND SubCategory_Name='$fields{'subcategory'}'");
> >
>
> --
> ---------------------------------------------------------------------
> Please check "http://www.mysql.com/documentation/manual.php" before
> posting. To request this thread, e-mail mysql-thread60388@xxxxxxxxxxxxxxx
>
> To unsubscribe, send a message to:
> <mysql-unsubscribe-m.podlesny=labcat.com@xxxxxxxxxxxxxxx>
>
> If you have a broken mail client that cannot send a message to
> the above address (Microsoft Outlook), you can use:
> http://lists.mysql.com/php/unsubscribe.php
>
--
---------------------------------------------------------------------
Please check "http://www.mysql.com/documentation/manual.php" before
posting. To request this thread, e-mail mysql-thread60390@xxxxxxxxxxxxxxx
To unsubscribe, send a message to:
<mysql-unsubscribe-treed=ultraviolet.org@xxxxxxxxxxxxxxx>
If you have a broken mail client that cannot send a message to
the above address (Microsoft Outlook), you can use:
http://lists.mysql.com/php/unsubscribe.php
This mailing list archive is a service of Copilot Consulting.