--
PHPGT :: Grupo de PHPeros de Guatemala
email: ph...@googlegroups.com
www: http://php.develsystems.com | http://groups.google.com/group/phpgt/
--~--~---------~--~---------~--~---------~--~---------~--~---------~--~-------
-- Luis Fernando Gramajo P.
http://www.guatewireless.org
--~--~---------~--~---------~--~---------~--~---------~--~---------~--~-------
2009/12/16 Stuardo -StR- Rodríguez <s...@maphpia.com>:
--~--~---------~--~---------~--~---------~--~---------~--~---------~--~-------
-- Luis Fernando Gramajo P.
http://www.guatewireless.org
--~--~---------~--~---------~--~---------~--~---------~--~---------~--~-------
2009/12/17 Stuardo -StR- Rodríguez <s...@maphpia.com>:
http://slexy.org/view/s2FSkiQwK4
Hasta arriba esta la funcion que tome prestada.
--~--~---------~--~---------~--~---------~--~---------~--~---------~--~-------
-- Luis Fernando Gramajo P.
http://www.guatewireless.org
--~--~---------~--~---------~--~---------~--~---------~--~---------~--~-------
Database Tables
Table Rows Size Overhead
comments 7 8.70 KiB 0.00 B
links 7 8.70 KiB 0.00 B
options 7 8.70 KiB 0.00 B
postmeta 7 8.70 KiB 0.00 B
posts 7 8.70 KiB 0.00 B
term_relationships 7 8.70 KiB 0.00 B
term_taxonomy 7 8.70 KiB 0.00 B
terms 7 8.70 KiB 0.00 B
usermeta 7 8.70 KiB 0.00 B
users 7 8.70 KiB 0.00 B
--~--~---------~--~---------~--~---------~--~---------~--~---------~--~-------
-- Luis Fernando Gramajo P.
http://www.guatewireless.org
--~--~---------~--~---------~--~---------~--~---------~--~---------~--~-------
On Thu, Dec 17, 2009 at 10:08 AM, Luis Fernando Gramajo P.
array(10) { ["comments"]=> string(11) "wp_comments" ["links"]=>
string(8) "wp_links" ["options"]=> string(10) "wp_options"
["postmeta"]=> string(11) "wp_postmeta" ["posts"]=> string(8)
"wp_posts" ["term_relationships"]=> string(21)
"wp_term_relationships" ["term_taxonomy"]=> string(16)
"wp_term_taxonomy" ["terms"]=> string(8) "wp_terms" ["usermeta"]=>
string(11) "wp_usermeta" ["users"]=> string(8) "wp_users" }
gracias por la ayuda.
A decir verdad el output que les mande anteriormente despliega el
nombre de las tablas correctamente. Pero cuando el resultado del
size_redable es el que no cambia.
--~--~---------~--~---------~--~---------~--~---------~--~---------~--~-------
-- Luis Fernando Gramajo P.
http://www.guatewireless.org
--~--~---------~--~---------~--~---------~--~---------~--~---------~--~-------
2009/12/17 Stuardo Rodriguez <s...@strgt.cjb.net>:
# Ir por las tablas del MySQL
$_array = mysql_tables();
var_dump($_array);
if(is_array($_array))
{
foreach($_array as $key => $ft_table_name)
{
$_temp = $wpdb->get_row("SHOW TABLE STATUS ");
$overhead = $overhead + (int)$_temp->Data_free;
$_data[$key] = $_temp;
----------> echo("<br/>"); echo("<br/>");
var_dump($_data[$key]);
} // end foreach
asort($_data); //NO LO CONSIDERO NECESARIO testing
echo("<br/>"); echo("<br/>");
--------> var_dump($_data);
echo("<br/>"); echo("<br/>");
Y del dump me despliega lo mismo una y orta vez... aca esta el clavo entonces:
array(10) { ["comments"]=> object(stdClass)#148 (18) { ["Name"]=>
string(11) "fh_comments" ["Engine"]=> string(6) "MyISAM"
["Version"]=> string(2) "10" ["Row_format"]=> string(7) "Dynamic"
["Rows"]=> string(1) "7" ["Avg_row_length"]=> string(3) "395"
["Data_length"]=> string(4) "2768" ["Max_data_length"]=> string(15)
"281474976710655" ["Index_length"]=> string(4) "6144" ["Data_free"]=>
string(1) "0" ["Auto_increment"]=> string(5) "14369"
["Create_time"]=> string(19) "2009-12-15 17:26:33" ["Update_time"]=>
string(19) "2009-12-15 17:26:34" ["Check_time"]=> NULL
["Collation"]=> string(17) "latin1_swedish_ci" ["Checksum"]=> NULL
["Create_options"]=> string(0) "" ["Comment"]=> string(0) "" }
["links"]=> object(stdClass)#158 (18) { ["Name"]=> string(11)
"fh_comments" ["Engine"]=> string(6) "MyISAM" ["Version"]=>
string(2) "10" ["Row_format"]=> string(7) "Dynamic" ["Rows"]=>
string(1) "7" ["Avg_row_length"]=> string(3) "395" ["Data_length"]=>
string(4) "2768" ["Max_data_length"]=> string(15) "281474976710655"
["Index_length"]=> string(4) "6144" ["Data_free"]=> string(1) "0"
["Auto_increment"]=> string(5) "14369" ["Create_time"]=> string(19)
"2009-12-15 17:26:33" ["Update_time"]=> string(19) "2009-12-15
17:26:34" ["Check_time"]=> NULL ["Collation"]=> string(17)
"latin1_swedish_ci" ["Checksum"]=> NULL ["Create_options"]=>
string(0) "" ["Comment"]=> string(0) "" } ["options"]=>
object(stdClass)#159 (18) { ["Name"]=> string(11) "fh_comments"
["Engine"]=> string(6) "MyISAM" ["Version"]=> string(2) "10"
["Row_format"]=> string(7) "Dynamic" ["Rows"]=> string(1) "7"
["Avg_row_length"]=> string(3) "395" ["Data_length"]=> string(4)
"2768" ["Max_data_length"]=> string(15) "281474976710655"
["Index_length"]=> string(4) "6144" ["Data_free"]=> string(1) "0"
["Auto_increment"]=> string(5) "14369" ["Create_time"]=> string(19)
"2009-12-15 17:26:33" ["Update_time"]=> string(19) "2009-12-15
17:26:34" ["Check_time"]=> NULL ["Collation"]=> string(17)
"latin1_swedish_ci" ["Checksum"]=> NULL ["Create_options"]=>
string(0) "" ["Comment"]=> string(0) "" } ["postmeta"]=>
object(stdClass)#160 (18) { ["Name"]=> string(11) "fh_comments"
["Engine"]=> string(6) "MyISAM" ["Version"]=> string(2) "10"
["Row_format"]=> string(7) "Dynamic" ["Rows"]=> string(1) "7"
["Avg_row_length"]=> string(3) "395" ["Data_length"]=> string(4)
"2768" ["Max_data_length"]=> string(15) "281474976710655"
["Index_length"]=> string(4) "6144" ["Data_free"]=> string(1) "0"
["Auto_increment"]=> string(5) "14369" ["Create_time"]=> string(19)
"2009-12-15 17:26:33" ["Update_time"]=> string(19) "2009-12-15
17:26:34" ["Check_time"]=> NULL ["Collation"]=> string(17)
"latin1_swedish_ci" ["Checksum"]=> NULL ["Create_options"]=>
string(0) "" ["Comment"]=> string(0) "" } ["posts"]=>
--~--~---------~--~---------~--~---------~--~---------~--~---------~--~-------
-- Luis Fernando Gramajo P.
http://www.guatewireless.org
--~--~---------~--~---------~--~---------~--~---------~--~---------~--~-------
2009/12/17 Luis Fernando Gramajo P. <fhe...@gmail.com>:
Puse el vardump tambien aca
array(10) { ["comments"]=> object(stdClass)#148 (18) { ["Name"]=>
string(11) "fh_comments" ["Engine"]=> string(6) "MyISAM"
["Version"]=> string(2) "10" ["Row_format"]=> string(7) "Dynamic"
["Rows"]=> string(1) "7" ["Avg_row_length"]=> string(3) "395"
["Data_length"]=> string(4) "2768" ["Max_data_length"]=> string(15)
"281474976710655" ["Index_length"]=> string(4) "6144" ["Data_free"]=>
string(1) "0" ["Auto_increment"]=> string(5) "14369"
["Create_time"]=> string(19) "2009-12-15 17:26:33" ["Update_time"]=>
string(19) "2009-12-15 17:26:34" ["Check_time"]=> NULL ......
--
array(10) {
["comments"]=>
string(11) "wp_comments"
["links"]=>
string(8) "wp_links"
["options"]=>
string(10) "wp_options"
["postmeta"]=>
string(11) "wp_postmeta"
["posts"]=>
string(8) "wp_posts"
["term_relationships"]=>
string(21) "wp_term_relationships"
["term_taxonomy"]=>
string(16) "wp_term_taxonomy"
["terms"]=>
string(8) "wp_terms"
["usermeta"]=>
string(11) "wp_usermeta"
["users"]=>
string(8) "wp_users"
}
Pero si dicen que el codigo anterior esta bien, sospecho que va por la
funcion para sacar las tablas.
--~--~---------~--~---------~--~---------~--~---------~--~---------~--~-------
-- Luis Fernando Gramajo P.
http://www.guatewireless.org
--~--~---------~--~---------~--~---------~--~---------~--~---------~--~-------
<?php if(is_array($_data)) :?>
<?php foreach($_data as $ft_table_name => $_temp) :?>
<tr>
<? echo '<pre />'; var_dump($_temp); ?>
<td><?php echo $ft_table_name; ?></td>
<td align="right" nowrap="nowrap">
<?php echo (int)$_temp->Rows; ?>
</td>
<td align="right" nowrap="nowrap">
<?php echo size_readable(($_temp->Data_length
+ $_temp->Index_length), null, 'bi', '%01.2f %s'); ?>
</td>
<td align="right" nowrap="nowrap">
<?php echo size_readable($_temp->Data_free,
null, 'bi', '%01.2f %s'); ?>
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<?php endif;
Y me despleiga lo siguiente:
object(stdClass)#148 (18) {
["Name"]=>
string(11) "wp_comments"
["Engine"]=>
string(6) "MyISAM"
["Version"]=>
string(2) "10"
["Row_format"]=>
string(7) "Dynamic"
["Rows"]=>
string(1) "1"
["Avg_row_length"]=>
string(3) "232"
["Data_length"]=>
string(3) "232"
["Max_data_length"]=>
string(15) "281474976710655"
["Index_length"]=>
string(4) "6144"
["Data_free"]=>
string(1) "0"
["Auto_increment"]=>
string(1) "2"
["Create_time"]=>
string(19) "2009-12-15 16:38:30"
["Update_time"]=>
string(19) "2009-12-15 16:38:30"
["Check_time"]=>
string(19) "2009-12-15 17:18:27"
["Collation"]=>
string(15) "utf8_general_ci"
["Checksum"]=>
NULL
["Create_options"]=>
string(0) ""
["Comment"]=>
string(0) ""
}
object(stdClass)#157 (18) {
["Name"]=>
string(11) "wp_comments"
["Engine"]=>
string(6) "MyISAM"
["Version"]=>
string(2) "10"
["Row_format"]=>
string(7) "Dynamic"
["Rows"]=>
string(1) "1"
["Avg_row_length"]=>
string(3) "232"
["Data_length"]=>
string(3) "232"
["Max_data_length"]=>
string(15) "281474976710655"
["Index_length"]=>
string(4) "6144"
["Data_free"]=>
string(1) "0"
["Auto_increment"]=>
string(1) "2"
["Create_time"]=>
string(19) "2009-12-15 16:38:30"
["Update_time"]=>
string(19) "2009-12-15 16:38:30"
["Check_time"]=>
string(19) "2009-12-15 17:18:27"
["Collation"]=>
string(15) "utf8_general_ci"
["Checksum"]=>
NULL
["Create_options"]=>
string(0) ""
["Comment"]=>
string(0) ""
}
object(stdClass)#158 (18) {
["Name"]=>
string(11) "wp_comments"
["Engine"]=>
string(6) "MyISAM"
["Version"]=>
string(2) "10"
["Row_format"]=>
string(7) "Dynamic"
["Rows"]=>
string(1) "1"
["Avg_row_length"]=>
string(3) "232"
["Data_length"]=>
string(3) "232"
["Max_data_length"]=>
string(15) "281474976710655"
["Index_length"]=>
string(4) "6144"
["Data_free"]=>
string(1) "0"
["Auto_increment"]=>
string(1) "2"
["Create_time"]=>
string(19) "2009-12-15 16:38:30"
["Update_time"]=>
string(19) "2009-12-15 16:38:30"
["Check_time"]=>
string(19) "2009-12-15 17:18:27"
["Collation"]=>
string(15) "utf8_general_ci"
["Checksum"]=>
NULL
["Create_options"]=>
string(0) ""
["Comment"]=>
string(0) ""
}
object(stdClass)#159 (18) {
["Name"]=>
string(11) "wp_comments"
["Engine"]=>
string(6) "MyISAM"
["Version"]=>
string(2) "10"
["Row_format"]=>
string(7) "Dynamic"
["Rows"]=>
string(1) "1"
["Avg_row_length"]=>
string(3) "232"
["Data_length"]=>
string(3) "232"
["Max_data_length"]=>
string(15) "281474976710655"
["Index_length"]=>
string(4) "6144"
["Data_free"]=>
string(1) "0"
["Auto_increment"]=>
string(1) "2"
["Create_time"]=>
string(19) "2009-12-15 16:38:30"
["Update_time"]=>
string(19) "2009-12-15 16:38:30"
["Check_time"]=>
string(19) "2009-12-15 17:18:27"
["Collation"]=>
string(15) "utf8_general_ci"
["Checksum"]=>
NULL
["Create_options"]=>
string(0) ""
["Comment"]=>
string(0) ""
}
object(stdClass)#160 (18) {
["Name"]=>
string(11) "wp_comments"
["Engine"]=>
string(6) "MyISAM"
["Version"]=>
string(2) "10"
["Row_format"]=>
string(7) "Dynamic"
["Rows"]=>
string(1) "1"
["Avg_row_length"]=>
string(3) "232"
["Data_length"]=>
string(3) "232"
["Max_data_length"]=>
string(15) "281474976710655"
["Index_length"]=>
string(4) "6144"
["Data_free"]=>
string(1) "0"
["Auto_increment"]=>
string(1) "2"
["Create_time"]=>
string(19) "2009-12-15 16:38:30"
["Update_time"]=>
string(19) "2009-12-15 16:38:30"
["Check_time"]=>
string(19) "2009-12-15 17:18:27"
["Collation"]=>
string(15) "utf8_general_ci"
["Checksum"]=>
NULL
["Create_options"]=>
string(0) ""
["Comment"]=>
string(0) ""
}
object(stdClass)#161 (18) {
["Name"]=>
string(11) "wp_comments"
["Engine"]=>
string(6) "MyISAM"
["Version"]=>
string(2) "10"
["Row_format"]=>
string(7) "Dynamic"
["Rows"]=>
string(1) "1"
["Avg_row_length"]=>
string(3) "232"
["Data_length"]=>
string(3) "232"
["Max_data_length"]=>
string(15) "281474976710655"
["Index_length"]=>
string(4) "6144"
["Data_free"]=>
string(1) "0"
["Auto_increment"]=>
string(1) "2"
["Create_time"]=>
string(19) "2009-12-15 16:38:30"
["Update_time"]=>
string(19) "2009-12-15 16:38:30"
["Check_time"]=>
string(19) "2009-12-15 17:18:27"
["Collation"]=>
string(15) "utf8_general_ci"
["Checksum"]=>
NULL
["Create_options"]=>
string(0) ""
["Comment"]=>
string(0) ""
}
object(stdClass)#162 (18) {
["Name"]=>
string(11) "wp_comments"
["Engine"]=>
string(6) "MyISAM"
["Version"]=>
string(2) "10"
["Row_format"]=>
string(7) "Dynamic"
["Rows"]=>
string(1) "1"
["Avg_row_length"]=>
string(3) "232"
["Data_length"]=>
string(3) "232"
["Max_data_length"]=>
string(15) "281474976710655"
["Index_length"]=>
string(4) "6144"
["Data_free"]=>
string(1) "0"
["Auto_increment"]=>
string(1) "2"
["Create_time"]=>
string(19) "2009-12-15 16:38:30"
["Update_time"]=>
string(19) "2009-12-15 16:38:30"
["Check_time"]=>
string(19) "2009-12-15 17:18:27"
["Collation"]=>
string(15) "utf8_general_ci"
["Checksum"]=>
NULL
["Create_options"]=>
string(0) ""
["Comment"]=>
string(0) ""
}
object(stdClass)#163 (18) {
["Name"]=>
string(11) "wp_comments"
["Engine"]=>
string(6) "MyISAM"
["Version"]=>
string(2) "10"
["Row_format"]=>
string(7) "Dynamic"
["Rows"]=>
string(1) "1"
["Avg_row_length"]=>
string(3) "232"
["Data_length"]=>
string(3) "232"
["Max_data_length"]=>
string(15) "281474976710655"
["Index_length"]=>
string(4) "6144"
["Data_free"]=>
string(1) "0"
["Auto_increment"]=>
string(1) "2"
["Create_time"]=>
string(19) "2009-12-15 16:38:30"
["Update_time"]=>
string(19) "2009-12-15 16:38:30"
["Check_time"]=>
string(19) "2009-12-15 17:18:27"
["Collation"]=>
string(15) "utf8_general_ci"
["Checksum"]=>
NULL
["Create_options"]=>
string(0) ""
["Comment"]=>
string(0) ""
}
object(stdClass)#164 (18) {
["Name"]=>
string(11) "wp_comments"
["Engine"]=>
string(6) "MyISAM"
["Version"]=>
string(2) "10"
["Row_format"]=>
string(7) "Dynamic"
["Rows"]=>
string(1) "1"
["Avg_row_length"]=>
string(3) "232"
["Data_length"]=>
string(3) "232"
["Max_data_length"]=>
string(15) "281474976710655"
["Index_length"]=>
string(4) "6144"
["Data_free"]=>
string(1) "0"
["Auto_increment"]=>
string(1) "2"
["Create_time"]=>
string(19) "2009-12-15 16:38:30"
["Update_time"]=>
string(19) "2009-12-15 16:38:30"
["Check_time"]=>
string(19) "2009-12-15 17:18:27"
["Collation"]=>
string(15) "utf8_general_ci"
["Checksum"]=>
NULL
["Create_options"]=>
string(0) ""
["Comment"]=>
string(0) ""
}
object(stdClass)#165 (18) {
["Name"]=>
string(11) "wp_comments"
["Engine"]=>
string(6) "MyISAM"
["Version"]=>
string(2) "10"
["Row_format"]=>
string(7) "Dynamic"
["Rows"]=>
string(1) "1"
["Avg_row_length"]=>
string(3) "232"
["Data_length"]=>
string(3) "232"
["Max_data_length"]=>
string(15) "281474976710655"
["Index_length"]=>
string(4) "6144"
["Data_free"]=>
string(1) "0"
["Auto_increment"]=>
string(1) "2"
["Create_time"]=>
string(19) "2009-12-15 16:38:30"
["Update_time"]=>
string(19) "2009-12-15 16:38:30"
["Check_time"]=>
string(19) "2009-12-15 17:18:27"
["Collation"]=>
string(15) "utf8_general_ci"
["Checksum"]=>
NULL
["Create_options"]=>
string(0) ""
["Comment"]=>
string(0) ""
}
--~--~---------~--~---------~--~---------~--~---------~--~---------~--~-------
-- Luis Fernando Gramajo P.
http://www.guatewireless.org
--~--~---------~--~---------~--~---------~--~---------~--~---------~--~-------
pero le pela la estaca, justo cal agregar el size. Gracias
--~--~---------~--~---------~--~---------~--~---------~--~---------~--~-------
-- Luis Fernando Gramajo P.
http://www.guatewireless.org
--~--~---------~--~---------~--~---------~--~---------~--~---------~--~-------
--~--~---------~--~---------~--~---------~--~---------~--~---------~--~-------
-- Luis Fernando Gramajo P.
http://www.guatewireless.org
--~--~---------~--~---------~--~---------~--~---------~--~---------~--~-------
On Thu, Dec 17, 2009 at 5:24 PM, Luis Fernando Gramajo P.
--~--~---------~--~---------~--~---------~--~---------~--~---------~--~-------
-- Luis Fernando Gramajo P.
http://www.guatewireless.org
--~--~---------~--~---------~--~---------~--~---------~--~---------~--~-------