php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #49994 mysql_num_fields error agregar nota
Submitted: 2009-10-25 23:35 UTC Modified: 2009-10-31 14:03 UTC
From: okhugo2000 at yahoo dot com Assigned:
Status: Not a bug Package: Website problem
PHP Version: Irrelevant OS: xp
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: okhugo2000 at yahoo dot com
New email:
PHP Version: OS:

 

 [2009-10-25 23:35 UTC] 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.


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-10-31 14:03 UTC] kalle@php.net
.
 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Fri Jun 19 02:00:01 2026 UTC