Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Dynamic List/Menu help

New Here ,
May 15, 2009 May 15, 2009

Trying to build a database search form, (php Mysql) everything ok until I created a dynamic List/Menu using the DW (CS4) wizard. I'm getting duplicates in my results. How do I stop duplicates and get uniques instead. Here's the code. Someone please help....

select nalemme="select2" id="select2">
      <option value="">Country</option>
      <?php
do { 
?>
      <option value="<?php echo $row_associations['Site_ID']?>"><?php echo $row_associations['Bcode_Community']?></option>
      <?php
} while ($row_associations = mysql_fetch_assoc($associations));
  $rows = mysql_num_rows($associations);
  if($rows > 0) {
      mysql_data_seek($associations, 0);
      $row_associations = mysql_fetch_assoc($associations);
  }
?>
    </select>

TOPICS
Server side applications
476
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
May 15, 2009 May 15, 2009

How do I stop duplicates and get uniques instead.

Use your SQL query to select only unique values:

SELECT DISTINCT thisColumn

FROM myTable

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
May 15, 2009 May 15, 2009
LATEST

Thanks, I had thought of this and tried it but must have got my syntax  wrong as it didn't work. Now I know i'm on the right track I'll try again.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines