Invisible Mystery Options in Drop-down

[the Beginner or MySQL forums may be a better fit for what follows; if so, please feel free to let me know]

Background
This is a simple audience rating interface for a film festival, and I want to limit the options available in a drop-down selection to only films users have not already rated.

Problem
It’s working, mostly: I can confirm that the drop-down list has the right number of options in it for a given rater (I’m using cookies for this), but they’re invisible. Does anything jump out about the code below?

[php]
<?php

        $sqli = "SELECT FILM_NAMES.ID, FILM_NAMES.FILM_NAME FROM FILM_NAMES WHERE FILM_NAMES.ID NOT IN ( SELECT FILM_NAMES.ID FROM FILM_NAMES INNER JOIN VOTEMAIN ON FILM_NAMES.ID=VOTEMAIN.FILM_ID WHERE VOTEMAIN.VOTER = 'table_voter' )";
        $result = mysqli_query($con, $sqli);
              while ($row = mysqli_fetch_array($result)) {
                 echo '<option value ='.$row['FILM_NAMES.ID'].'>'.$row['FILM_NAMES.FILM_NAME'].'</option>';
               }
        ?>
  </select>[/php]

$row[‘FILM_NAMES.ID’] and $row[‘FILM_NAMES.FILM_NAME’] don’t exist. The table name part isn’t present in the fetched data. Only the column name is.

If you had php’s error_reporting set to E_ALL and display_errors set to ON, php would have helped you find this problem, since there would have been undefined index errors.

You can use one of php’s debugging statements, such as var_dump(), on the $row variable, to see exactly what $row contains.

Well that was fast!

Thanks, phdr, and thanks for the extra tips.

Sponsor our Newsletter | Privacy Policy | Terms of Service