close
Warning:
Failed to sync with repository "ogBrowser-Git": (1366, "Incorrect string value: '\\xF0\\x9F\\x93\\xA6 I...' for column 'message' at row 1"); repository information may be out of date. Look in the Trac log for more information including mitigation strategies.
918-git-images-111dconfigfileconfigure-oglivegit-imageslgromero-new-oglivemainmaint-cronmount-efivarfsmultivmmultivm-ogboot-installerogClonningEngineogboot-installer-jenkinsoglive-ipv6test-python-scriptsticket-301ticket-50ticket-50-oldticket-577ticket-585ticket-611ticket-612ticket-693ticket-700ubu24tplunification2use-local-agent-oglivevarios-instalacionwebconsole3
| Line | |
|---|
| 1 | <?php |
|---|
| 2 | // ************************************************************************************************************************************************* |
|---|
| 3 | // Aplicación WEB: ogAdmWebCon. |
|---|
| 4 | // Autor: José Manuel Alonso (E.T.S.I.I.) Universidad de Sevilla |
|---|
| 5 | // Fecha Creación: 2009-2010 |
|---|
| 6 | // Fecha Última modificación: Agosto-2010 |
|---|
| 7 | // Nombre del fichero: TomanDatos.php |
|---|
| 8 | // Descripción : |
|---|
| 9 | // Recupera datos de una tabla |
|---|
| 10 | // Parametros: |
|---|
| 11 | // - cmd:Un comando ya operativo (con conexión abierta) |
|---|
| 12 | // - idcentro:Centro al que pertene el registro donde se encuentra el dato a recuperar, será 0 para no contemplar este dato |
|---|
| 13 | // - nombretabla: Nombre de la tabla origen de los datos |
|---|
| 14 | // - identificador: Valor del campo identificador del registro |
|---|
| 15 | // - nombreid: Nombre del campo identificador del registro |
|---|
| 16 | // - nombreliteral: Array asosiativa con los nombres de los campo que se quieren recuperar |
|---|
| 17 | // - swid: Indica 0= El identificador es tipo alfanumérico 1= EI identificador es tipo numérico (valor por defecto) |
|---|
| 18 | // ************************************************************************************************************************************************* |
|---|
| 19 | function TomanDatos($cmd,$nombretabla,$identificador,$nombreid,$nombreliterales,$swid=1){ |
|---|
| 20 | $Dato=""; |
|---|
| 21 | if (empty($identificador)) $identificador=0; |
|---|
| 22 | $rs=new Recordset; |
|---|
| 23 | if($swid==0) |
|---|
| 24 | $cmd->texto="SELECT * FROM ".$nombretabla." WHERE ".$nombreid."='".$identificador."'"; |
|---|
| 25 | else |
|---|
| 26 | $cmd->texto='SELECT * FROM '.$nombretabla.' WHERE '.$nombreid.'='.$identificador; |
|---|
| 27 | $rs->Comando=&$cmd; |
|---|
| 28 | if (!$rs->Abrir()) return(""); // Error al abrir recordset |
|---|
| 29 | if (!$rs->EOF){ |
|---|
| 30 | for($x=0;$x<sizeof($nombreliterales);$x++){ |
|---|
| 31 | $Dato[$nombreliterales[$x]]=$rs->campos[$nombreliterales[$x]]; |
|---|
| 32 | } |
|---|
| 33 | } |
|---|
| 34 | $rs->Cerrar(); |
|---|
| 35 | return($Dato); |
|---|
| 36 | } |
|---|
Note: See
TracBrowser
for help on using the repository browser.