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
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
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

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-10-31 14:03 UTC] kalle@php.net
.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat May 04 14:01:32 2024 UTC