Does the simple case (without specifying MainID) work?
And are you pretty sure that $row['MainID'] actually holds a valid value?
Have you tried printing the whole of the above query to see what it actually contains?
If it looks valid try copy-paste that query into the mysql command-line to see what comes up.
I tried the query in the mysql command-line and this does give me the data I want to get.
$row['MainID'] does hold a valid value is this should mean I doing something wrong at displaying the values, doesn't it?
I just started using mysql and php it will probebly be a stupid mistake I made.
I get one or more values back using the mysql command-line and I'm trying to display the values one by one by using $result = mysql_fetch_row (&res) (I tried mysql_fetch_array as well) but it only displays one result by using $result[0].
$result[1] or higher doesn't give me anything, what could be the problem?