473,715 Members | 6,096 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("SH OW tablename STATUS FROM databasename;") ;

i have also tried = $result = mysql_query("SH OW 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_arr ay($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_arr ay(): 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_arr ay($result))

thanks a lot.
Jan 29 '08 #1
1 2511
stepterr
157 New Member
hi

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

i have also tried = $result = mysql_query("SH OW 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_arr ay($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_arr ay(): 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_arr ay($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
3534
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 page. Does anybody have idea about this ?
0
1552
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 variables don't change, ever... moderatly concrete: multiple possible servers, one set of results each, the variables don't change, ever.. abstract: multiple servers returning a table of some results. Things are what they are when they are...
0
4133
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 works fine. Binary logging (log-bin) is enabled on both. I have a feeling about one thing that might be wrong - "Binlog_do_db" on the master server is empty when it should be "vmail".
0
4349
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 inferred that this functionality would extend to the SHOW statement: SELECT * FROM (SHOW TABLE STATUS FROM SomeDataBase)
2
1735
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. <%@ Language=VBScript %> <%
2
11532
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 STATUS FROM databasename"); i get the following error message
0
1557
by: runway27 | last post by:
hi my question is about "SHOW TABLE STATUS LIKE 'tablename'"; following is the code i am presently using ================================================================== $conn = mysql_connect("localhost","username","password");
3
4893
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 database, something I always wanted. It took me some trial and error, but as it now stands, I made several tables (Companies, Cast, Genre, Country, Character, Director, Status, Movies)... The table Movies contains all the info on each movie while the...
1
3810
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 properties alt in img tag istead of picture . place of the pictures is saved in the database(my database is with mysql) and in home page i fetch properties of the product and address of place that pictures is located output of the code in the...
0
8718
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9340
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9196
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9103
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7973
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6646
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5967
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4477
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3175
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.