#49994 [Opn->Bgs]: mysql_num_fields error agregar nota

From: Date: Sat, 31 Oct 2009 14:03:47 +0000
Subject: #49994 [Opn->Bgs]: mysql_num_fields error agregar nota
References: 1  Groups: php.webmaster 
Request: Send a blank email to php-webmaster+get-6304@lists.php.net to get a copy of this message
ID: 49994 Updated by: kalle@php.net Reported By: okhugo2000 at yahoo dot com -Status: Open +Status: Bogus Bug Type: Website problem Operating System: xp PHP Version: Irrelevant New Comment: . Previous Comments: ------------------------------------------------------------------------ [2009-10-25 23:35:32] okhugo2000 at yahoo dot com Description: ------------ Intenté poner esta nota: funcion genérica para crear una tabla con cualquier SELECT, la hice como herramienta de depuración <?PHP function ver_tabla($con,$pega,$ver=0,$largo=100){ /* $con= consulta $pega= identificador de conexión $ver= mostrar el contenido de la consulta $largo=carateres en la columna */ $tabla=" <!--Generado con el script ver_tabla.Consulta:\n". $con."\n -->\n "; if($ver){$tabla.="<pre>".$con."</pre>";} $res=mysql_query($con,$pega); $t_c=mysql_num_fields($res); $tabla.= mysql_num_rows($res). " registros\n" ; $tabla.= "<table border=\"1\">\n<tr>"; for($x=0; $x<$t_c; $x++){ $t=mysql_field_name($res, $x); $tabla.="\t<th title=\" ".$t." \" >".substr($t,0,$largo)."</th>\n"; } $tabla.="</tr>\n"; while ($fila = mysql_fetch_array($res)){ $tabla.="\t<tr>\n"; for($x=0; $x<$t_c; $x++){ if(!($fila[$x]{0})){$fila[$x]="?";} $tabla.="\t<td title=\" ".$fila[$x]." \" >".substr($fila[$x],0,$largo)."</td>\n"; } $tabla.="</tr>\n"; } $tabla.="</table>"; return $tabla; } ?> Reproduce code: --------------- --- From manual page: function.mysql-num-fields --- Expected result: ---------------- Gracias!! Actual result: -------------- There was an internal error processing your submission. Please try to submit again later. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=49994&edit=1

« previous php.webmaster (#6304) next »