I hope that I can explain this problem in a logical and clear way.

In MySQL, I have two tables for information::

foo, which contains
FooID, FooLName, FooFName

and

foocontact, which contains
FooID, FooContactID, FooEmail, FooPhone, FooAddress1, etc.

Honestly, I can't remember why I split up the names and contact info into
two separate tables, but that's the way it is...

In the first hundred or so entries of foocontact, FooID and FooContactID are
identical (both columns are auto-increment).  But because I've occasionally
had problems loading data into the database, and have had to reload some
entries while delete or forgetting to delete others, the numbers are now out
of synch.  For some entries, that doesn't seem to be a problem (I might have
fixed them by hand at an earlier date, but I can't remember), but for
others, it might be.

That may not matter, though.  What I'd like to do is call up info from both
foo and foocontact using only the FooID, which is passed in the url.

I can't understand, though, why the where clause in the folllowing line
isn't working the way I want it to:

SELECT FooLName, FooPhone, FooEmail
FROM foo, foocontact
WHERE foocontact.FooID=$FooID and foo.FooID=$FooID;


I've also tried:

WHERE foocontact.FooID=$FooID and foo.FooID=foocontact.FooID;

any idea why that doesn't work?  does any of this make sense?  sorry if it
doesn't, and thanks in advance for your help.

Matt




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to