Jump to content

List in drop down bar?


Toy

Recommended Posts

Hmm.. I don't really understand but thanks for your time.

 

My code goes along those lines..

 

<?php
if(isset($_GET['id'])) {
$result = mysql_query("SELECT * FROM table WHERE id='" . mysql_real_escape_string($_GET['id']) . "'");
while($display = mysql_fetch_array($result))
  {
echo '<option value="'. $display['id'] .'">'. $display['title'] .'</option>';
  }
} else {
  }
?>

 

<?php
if(isset($_GET['id'])) {
$result = mysql_query("SELECT * FROM table WHERE id='" . mysql_real_escape_string($_GET['id']) . "'");
$i = 1;
while($display = mysql_fetch_array($result))
  {
echo "\t" . '<option value="' . $display['id'] . '">' . $i . ' - ' . $display['title'] . '</option>' . "\r\n";
$i++;
  }
} else {
  }
?>

 

 

<?php
if(isset($_GET['id'])) {
$result = mysql_query("SELECT * FROM table WHERE id='" . mysql_real_escape_string($_GET['id']) . "'");
$i = 1;
while($display = mysql_fetch_array($result))
  {
echo "\t" . '<option value="' . $display['id'] . '">' . $i . ' - ' . $display['title'] . '</option>' . "\r\n";
$i++;
  }
} else {
  }
?>

 

Works like a charm! Thank you.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.