Ver Mensaje Individual
  #8 (permalink)  
Antiguo 05/04/2012, 12:47
Wainman
 
Fecha de Ingreso: abril-2012
Mensajes: 15
Antigüedad: 12 años
Puntos: 0
Respuesta: Llenar un Option Box o Combobox desde DB

Ahora me tira un error en la lina 9:
Parse error: syntax error, unexpected T_STRING in /home/Super/cargaarticulos.php on line 9

Cita:
Iniciado por gjx2 Ver Mensaje
Copialo tal cual
Código PHP:
Ver original
  1. <?php
  2. /* Me conecto a la base de datos */  
  3.     $hand = mysql_connect("localhost","Ustesteo","Pass")    
  4.     or die("Problemas en la conexion");
  5.     mysql_select_db("DBTest",$hand)  
  6.     or die("Problemas en la seleccion de la base de datos");
  7.  
  8.     /* Query para armar el tag option */  
  9.     $qry = mysql_query("select * from Supers", $hand);  
  10.     $opt="";
  11.     while ($rec = mysql_fetch_array($qry))  
  12.     {  
  13.     /* Armo las opciones del cuadro de selección */  
  14.     if ( $rec["nomsup"] == 1 )  
  15.         $opt .= "<option value=".$rec["nomsup"]." selected>".$rec["dirsup"]."</option>\n";  
  16.     else  
  17.         $opt .= "<option value=".$rec["nomsup"].">".$rec["dirsup"]."</option>\n";  
  18.     }  
  19. echo <<<HTML
  20.     <form method="POST" action="" name="Supers">  
  21.         <select size="1" name="Supers" tabindex="1">  
  22.             "$opt"
  23.         </select><br><br>  
  24. HTML;
  25. ?>