At 16:09 06/01/2003 06/01/2003, Doug Parker wrote:
I have a relational database issue that I'll simplify for the sake of this post. [...] So it would be like this:

id | company_id | status | company
------------------------------------------------------------------------
1 46 Active Jones Inc.
2 54 Inactive Baker Inc.

Using SQL the following SELECT should be the solution:

SELECT projects.id, company_id, status, company
FROM projects, clients
WHERE projects.company_id = clients.id

You can of course add any other filter in the WHERE clause using the usual AND OR NOT operators.

Of course you have to embed this command in an appropriate PhP statement, e.g. using the odbc library, and having an open connection $conn to the DB:

odbc_exec($conn, 'SELECT ... ');

Hope this will be enough to solve your problem.



Paolo Bonavoglia

Cannaregio 3027/R
30121 V E N E Z I A
========================================================
Sito del Liceo Foscarini http://www.liceofoscarini.it/
Astronomia e Calendari http://digilander.iol.it/paolobona/astro/home.html


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



Reply via email to