| Recommend this page to a friend! |
| All class groups | > | All authors | > | Packages of Luis Gabriel Hernandez Valderrama (2) | > | Mission progress status | > | Reputation |
|
|||||||||||||||||||||||||||||||
| A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z |
| ||||
| This class can display and edit MySQL table records in a Web page. It can connect to a given MySQL database and retrieves data from that table to display it on a Web page. The class can also display a form to allow the user to enter data to insert in new records of the given MySQL table. In Spanish: CMySqldbHTML esta diseñado para la interacción con bases de datos mysql phpmyadmin y generar HTML a partir de los datos. CMySqldbHTML is designed for the interaction between data bases mysql phpmyadmin and and create HTML code with the data. El constructor requiere los parametros - The constructor parameters are: * $tablenm = Nombre de la tabla - Name of the table * $db = Nombre de la base de datos - Name of data base * $host = Nombre o direccion del host o servidor - Name or adress of the host or server * $user = Nombre de usuario para conexion con la base de datos - User name to connect with the database * $pass = Conrtaseña para conexion con la base de datos - User password to connect with the database * * Hay dos formas de usar la clase - There are two ways for the use of the class: * * 1.- $tablenm = "": Si entregamos el nombre de la tabla vacio - If set the table name empty * $data : Almacena los nombres de las bases de datos - Save the names of the databases * $tblsdb : Almacena los nombres de las tablas de la base de datos entregada - Save the names of the tables in the database gived * * 2.- $tablenm <> "": Entregando el nombre de una tabla existente - Setting the table name created. * $numfilas : Numero de filas de la tabla - Numbers of rows in the table * $numcols : Numero de columnas de la tabla - Numbers of columns in the table * $hddata : Encabezados de la tabla - Table headers * $tpar : Tipos de campos de la tabla - Types of table fields * $lenar : Longitud máxima para los campos de la tabla - Maximum length for the table's fields * $bandar : Banderas de los campos de la tabla - Flags for the table's fields * $data : Almacena el contenido de la tabla por filas - Save the rows content of the table * * Metodos: * * showrCObjeto() : * 1.- Escribe el codigo HTML para ver la lista de las bases de datos y las tablas de la base de datos asignada * - Write the HTML code to see the list of databases and tables of the assigned database * 2.- Escribe el codigo HTML para ver la tabla con sus encabezados * - Write the HTML code to see the table with its headings * * Solo para caso 2 - Only case two(2). * getrowdata($id,$colid) * Devuelve un array con los datos del $id, de encontrarlo en la columna o encabezado $colid * Returns an array with the $id data, if found in the $colid field * * drawrowdata($id,$colid) * Escrible el codigo HTML en una tabla con los datos del $id encontrado en la columna $colid * Write the HTML code in a table with tha $id data, if found in the $colid field * * Para formularios - To forms * setArcolno($ar) * $arcolno = $ar, que son los campos que no queremos que dibuje en el formulario, * como timestamp o autoincremto u otro caso. * * drawForm($nm) * Escribe el codigo HTML de un formulario con los nombres de los campos de la tabla como etiquetas * remplazando '_' con ' ', para darle presentacion, y poder usar dichos nombres como name en los input * del formulario para su posterior captura con el metodo _POST. * El primer input lo hace autococus y crea un tabindex para el form. * Caracteristicas especiales: * $arcolno permite que en el formulario no dibuje determinados campos, como timestamp o autoincremto u otro caso. * $nm es el dato de autorrelleno para el primer campo, en caso de tenerlo lo autorrelena y solo lectura. * De lo contrario entregamos $nm=''. * * Write the HTML code of a form with the names of the fields in the table as labels replacing '_' with ' ', to give * presentation and be able to use these names as name in the input of the form for later capture with the _POST method. * The first input is done by autococus and creates a tabindex for the form. * Special features: * $arcolno allows the form not to draw certain fields, such as timestamp or autoincremto or another case. * $nm is the autofill data for the first field, if you have it, the self-fill and read only. * Otherwise we deliver $nm=''. * * getcmpsForm(): * Devuelve un array con los nombres de los encabezados - Return an array with header names * * procForm($arrfrm): * Procesa y graba los datos capturados y recibidos en $arrfrm, usa las variables $tstmp y $ord para identificar y * autorellenar, ya que normalmente son campos que el formulario no dibuja, y deben estar en $arcolno. * Para su uso despues de construir el objeto, damos valor a las variables con setTstmp($ts) y setOrd($o). * It processes and records the data captured and received in $ arrfrm, uses the variables $ tstmp and $ ord to identify * and autofill, since they are normally fields that the form does not draw, and they must be in $ arcolno. * For use after building the object, we give value to the variables with setTstmp ($ ts) and setOrd ($ o) * * Getters and Setters * getData() return $this->data; * getNumfilas() return $this->numfilas; * getNumcols() return $this->numcols; * getHddata() return $this->hddata; * getTblsdb() return $this->tblsdb; * getTablenm() return $this->tablenm; * setArcolno($ar) $this->arcolno = $ar; * getArcolno() return $this->arcolno; * setTstmp($ts) $this->tstmp = $ts; * setOrd($o) $this->ord = $o; * * @author Luis Gabriel Hernández - alias or nickname: luisga158 |
|
|
| A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z |