473,508 Members | 2,159 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Show Table Status

54 New Member
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
1 2498
stepterr
157 New Member
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.
Try changing your query to the following

Expand|Select|Wrap|Line Numbers
  1. "SHOW TABLE STATUS FROM databasename LIKE 'tablename'"
And for getting the results, since it will only return one row try using mysql_fetch_row. Take a look at this site for more info.
Jan 30 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

6
3517
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
1534
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
4082
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
4337
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
1717
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. ...
2
11512
by: Sudhakar | 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
1540
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
4870
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
3782
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
7225
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
7124
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7385
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...
1
7046
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7498
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...
0
5629
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5053
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4707
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3182
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.