Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

The best way to write data into table ?

Status
Not open for further replies.

JackTheRussel

Programmer
Aug 22, 2006
110
FI
Hi.

I need to get information from database tables.
I try to get part of information which I get when I run commands:
Code:
mysql>use database1;
mysql>show table status;
result:

Name: table1
Engine: InnoDB
Version: 10
Row_format: Compact
Rows: 1
Avg_row_length: 11255
Data_length: 15584
Max_data_length: 0
Index_length: 102
Data_free: 0
Auto_increment: 2
Create_time: 2006-12-12 13:16:51
Update_time: NULL
Check_time: NULL
Collation: latin1_swedish_ci
Checksum: NULL
Create_options:
Comment: InnoDB free: 341502 kB

Then table2... etc..

Which would be the smarters way to get these informations:

Name: table1
Engine: InnoDB
Size: #Size is Data_length: 15584 + Index_length: 102
Create_time: 2006-12-12 13:16:51

Where should I read these informations? to the table? hash?

What I try to do is a program, which would first read all databases into table and then one by one take table information from current database:

pseudocode:
Code:
get database names into @databases table.

for ($i=0; $i<@databases; $i++){
use $database[$i];
show table status; 
get intresting information into table/hash/?
}
 
Look at the DBI module.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[noevil]
Travis - Those Who Say It Cannot Be Done Are Usually Interrupted by Someone Else Doing It; Give the wrong symptoms, get the wrong solutions;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top