Database join question...

Unfortunately I'm not too good at writing code from just a top of my head without being in a real test environment.

You should also be able to have a single query inside loop like:

Code:
SELECT fs_score, qualificazione FROM scheda_atleta WHERE atleta = " . $mydb->Quote($myresult->id)." ORDER BY qualificazione ASC
$myscore = $mydb->loadObjectList();

but then you need to handle the cases where there are different amount of qualificatiozes per athlete.

So you could do it with multiple queries inside loop like:

Code:
SELECT fs_score FROM scheda_atleta AS a WHERE qualificazione = 1 AND atleta = " . $mydb->Quote($myresult->id)
$myscore1 = $db->loadResult(); //returns one value, players score at qualificazione 1

SELECT fs_score FROM scheda_atleta AS a WHERE qualificazione = 2 AND atleta = " . $mydb->Quote($myresult->id)
$myscore2 = $db->loadResult();

etc.

And then do your "if else".
 
We are in need of some funding.
More details.

Thank you.

Members online

No members online now.
Back
Top