selecting info & knowing what failed - please help

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
BigJonMX
Forum Newbie
Posts: 15
Joined: Sun Nov 20, 2005 11:28 am
Location: CardboardBox, WindyCity

selecting info & knowing what failed - please help

Post by BigJonMX »

Hi,
i have the following

Code: Select all

$q="SELECT height,girth FROM Th,Tg WHERE Th_id=Tg_id";
But sometimes there is no 'girth' record and sometimes there is no 'height' record

Is is possible to have my resultset tell me which field failed ?

$r=mysql_query($q, $connection);
if (!$r): $msg="No Records because..."

Thanx
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

It looks like you are selecting two fields from two different tables without identifying which tables should be providing which data. What is your table structure for Table Th and Table Tg?
Post Reply