473,394 Members | 1,893 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

SHOW TABLE STATUS

hi

I am using MySQL - 4.1.22 when i use the following sql query
$result = mysql_query("SHOW tablename STATUS FROM databasename;");

i have also tried = $result = mysql_query("SHOW tablename STATUS FROM
databasename");

i get the following error message

================================================== ==
1064 Error Message : You have an error in your SQL syntax; check the
manual that corresponds to your MySQL server version for the right
syntax to use near 'tablename STATUS FROM databasename' at line 1
================================================== ==

also with the following code
================================================== =
while($array = mysql_fetch_array($result))
{
$total = $array[Data_length]+$array[Index_length];

echo "
Table: ".$array[Name]."<br />
Data Size: ".$array[Data_length]."<br />
Index Size: ".$array[Index_length]."<br />
Total Size: ".$total."<br />
Total Rows: ".$array[Rows]."<br />
Average Size Per Row: ".$array[Avg_row_length]."<br /><br />";
}
=================================================

i get the following error = " mysql_fetch_array(): supplied argument
is not a valid MySQL result resource "

please advice how to fix
1) SHOW TABLE query for version 4.1.22 and also is there a difference
in the SHOW TABLE query for MySQL - 3.23.58
2) while($array = mysql_fetch_array($result))

thanks a lot.
Jan 29 '08 #1
2 11504
Sudhakar wrote:
hi

I am using MySQL - 4.1.22 when i use the following sql query
$result = mysql_query("SHOW tablename STATUS FROM databasename;");

i have also tried = $result = mysql_query("SHOW tablename STATUS FROM
databasename");

i get the following error message

================================================== ==
1064 Error Message : You have an error in your SQL syntax; check the
manual that corresponds to your MySQL server version for the right
syntax to use near 'tablename STATUS FROM databasename' at line 1
================================================== ==

also with the following code
================================================== =
while($array = mysql_fetch_array($result))
{
$total = $array[Data_length]+$array[Index_length];

echo "
Table: ".$array[Name]."<br />
Data Size: ".$array[Data_length]."<br />
Index Size: ".$array[Index_length]."<br />
Total Size: ".$total."<br />
Total Rows: ".$array[Rows]."<br />
Average Size Per Row: ".$array[Avg_row_length]."<br /><br />";
}
=================================================

i get the following error = " mysql_fetch_array(): supplied argument
is not a valid MySQL result resource "

please advice how to fix
1) SHOW TABLE query for version 4.1.22 and also is there a difference
in the SHOW TABLE query for MySQL - 3.23.58
2) while($array = mysql_fetch_array($result))

thanks a lot.
This is a MySQL error. Try comp.database.mysql.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================

Jan 29 '08 #2
Jerry Stuckle wrote:
Sudhakar wrote:
>hi

I am using MySQL - 4.1.22 when i use the following sql query
$result = mysql_query("SHOW tablename STATUS FROM databasename;");

i have also tried = $result = mysql_query("SHOW tablename STATUS FROM
databasename");

i get the following error message

================================================= ===
1064 Error Message : You have an error in your SQL syntax; check the
manual that corresponds to your MySQL server version for the right
syntax to use near 'tablename STATUS FROM databasename' at line 1
================================================= ===

also with the following code
================================================= ==
while($array = mysql_fetch_array($result))
{
$total = $array[Data_length]+$array[Index_length];

echo "
Table: ".$array[Name]."<br />
Data Size: ".$array[Data_length]."<br />
Index Size: ".$array[Index_length]."<br />
Total Size: ".$total."<br />
Total Rows: ".$array[Rows]."<br />
Average Size Per Row: ".$array[Avg_row_length]."<br /><br />";
}
=============================================== ==

i get the following error = " mysql_fetch_array(): supplied argument
is not a valid MySQL result resource "

please advice how to fix
1) SHOW TABLE query for version 4.1.22 and also is there a difference
in the SHOW TABLE query for MySQL - 3.23.58
2) while($array = mysql_fetch_array($result))

thanks a lot.

This is a MySQL error. Try comp.database.mysql.
Oh sod off jerry.

The syntax is SHOW TABLE STATUS FROM 'database' (LIKE..)

That shows all the tables in the databse with useless info on them

If you want more on a specific table, then SHOW FIELDS FROM table (FROM
database)

etc works. As do SHOW INDEX, SHOW COLUMNS etc etc.

Get yourself an MySQL syntax book. When in doubt use the command line
tool to check syntax.
Jan 29 '08 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: bayram guzer | last post by:
hi everybody, i have very strange error. i can not see some of the asp pages on my browser. when i look from view source, all the source is there but browser does not show anything, just an empty...
0
by: Michael Conlen | last post by:
I'm developing a net-snmp module that executes a 'show status' command on a MySQL server and advertises the values. My choices seem to be super concrete: one server, one set of results, the...
0
by: John Yasaitis | last post by:
I seem to have replication set up correctly to only replicate one database named vmail.* Except when I try to update a table in vmail.* the changes do not replicate to the slave. Authentication...
0
by: Jerry | last post by:
The "SHOW TABLE STATUS" command seems to return a result set, just like "SELECT * FROM SomeTable". Therefore, since the following is valid: SELECT * FROM (SELECT * FROM SomeTable) I...
2
by: nikou_70 | last post by:
I have a page with one text box when I search name, return value such as (address, phone...) I show these value in the table but I want to show these in text box that I have in my page. ...
1
by: runway27 | last post by:
hi I am using MySQL - 4.1.22 when i use the following sql query $result = mysql_query("SHOW tablename STATUS FROM databasename;"); i have also tried = $result = mysql_query("SHOW tablename...
0
by: runway27 | last post by:
hi my question is about "SHOW TABLE STATUS LIKE 'tablename'"; following is the code i am presently using ================================================================== $conn =...
3
by: Margie | last post by:
Hello all, after getting no where with my Access 2007 database problem for an entire week I figured I could use some outside help. Wanting to skill myself in Access, I decided to make a movie...
1
oranoos3000
by: oranoos3000 | last post by:
hi would you please help me i have a online shopping center that i show pictures of the my product in home page. in the InterExplorer pictures is shown correctly but in Firefox browser is shown...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.