|
Posted by J.O. Aho on 10/01/75 11:52
Mr Smith wrote:
> I have not tried it yet, but.
>
> I need to open a table, look at every row of data. Then select a
> particular field every time, get its contents. Then do a search for
> that value in another table (in the same database), than return
> another value from the searched rows fields.
>
> From that returned value do the same again in another table (in the
> same database), and return another value.
>
> Then do a bit of calculations etc
>
> Then go back and look at the next row in the original table, and
> repeat again until the end.
Use JOIN in your query, see the mysql page who to use join (works the same way
in most sql) http://dev.mysql.com/doc/refman/5.0/en/join.html
Use a while-loop for fetching the data and calculate it, there is a somewhat
useful example in the php manual
http://www.php.net/manual/en/function.mysql-fetch-array.php
//Aho
[Back to original message]
|