Ver Mensaje Individual
  #1 (permalink)  
Antiguo 24/10/2006, 22:34
migueilichenco
 
Fecha de Ingreso: marzo-2004
Mensajes: 186
Antigüedad: 20 años, 2 meses
Puntos: 0
cambiar de estructurada a POO

hola a todo, buenos tal ves soy muy preguntos, pero me interesa aprender, y pues soy novato, actualemnte estoy transformando las funciones estructuradas que uso a poo y pues arme esta clase, solo que no la veo que se paresca a la POO, agradeceria si me podrian ayudar

Código PHP:
<?
    
class combobox
        
{
            public 
$sql;
            
            function 
__construct($table,$option,$value)
                {
                    
$this->table=$table;
                    
$this->option=$option;
                    
$this->value=$value;
                    
$sql "select * from ".$this->table;
                    
$this->sql=$sql;
                    
$result mysql_query($this->sql) or die (mysql_error());
                    
$this->result=$result;
                    echo 
"<select name='$this->table' class='botones'>";
                    while(
$fila mysql_fetch_assoc($this->result))
                        {
                            echo 
"<option value='$fila[$value]'>$fila[$option]</option>"
                        }    
                    echo 
"</select>"
                    
                    
mysql_close();

                }
        }
include(
"bd.php");
Conexion();
$test = new combobox("listas","producto","id_producto");
?>
Gracias de antemano a todos por sus respuestas, y espero no molestar
__________________
Software a Medida
voip Locutorios