Jump to content

[SOLVED] <select> problems!!!


messer

Recommended Posts

  function meniu_select() 
{ 

  include('dbinfo.inc.php'); 
  
$Link = mysql_connect ("localhost", $username, $password) or die ('error');
mysql_select_db($database) or die( "Unable to select database");

  $query = mysql_query("SELECT * FROM artikels ORDER BY ".addentities('ArtID').""); 
  $row = mysql_fetch_array($query);
    $select = '<select name="artikels[]">'; 

      while ($row = mysql_fetch_array($query)) 
    { 
      $select.= '<option value="'.addentities($row['ArtID']).'">'; 
      $select.= ''.addentities($row['ArtNummer']).' -:- '.addentities($row['ArtDescription']).'';   
      $select.= '</option>'; 
    } 

  $select.= '</select>'; 
  
  return $select; 

Link to comment
https://forums.phpfreaks.com/topic/154329-solved-problems/#findComment-811360
Share on other sites

  function meniu_select() 
{ 

  include('dbinfo.inc.php'); 
  
$Link = mysql_connect ("localhost", $username, $password) or die ('error');
mysql_select_db($database) or die( "Unable to select database");

  $query = mysql_query("SELECT * FROM artikels ORDER BY ".addentities('ArtID').""); 
  $row = mysql_fetch_array($query); // <-- REMOVE THIS LINE
    $select = '<select name="artikels[]">'; 

      while ($row = mysql_fetch_array($query)) 
    { 
      $select.= '<option value="'.addentities($row['ArtID']).'">'; 
      $select.= ''.addentities($row['ArtNummer']).' -:- '.addentities($row['ArtDescription']).'';   
      $select.= '</option>'; 
    } 

  $select.= '</select>'; 
  
  return $select; 

 

remove the line i pointed out

Link to comment
https://forums.phpfreaks.com/topic/154329-solved-problems/#findComment-811367
Share on other sites

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.