Displaying mySQL table structures in PHP
posted by Dotnetindex date: Monday, June 30, 2008
category: PHP
You can get information about tables using SHOW TABLE STATUS query. This query gives you a detailed info about all tables in your database. We can loop results:
- Name
- Engine
- Version
- Row_format
- Rows
- Avg_row_length
- Data_length
- Max_data_length
- Index_length
- Data_free
- Auto_increment
- Create_time
- Update_time
- Check_time
- Collation
- Checksum
- Create_options
- Comment
We can re-write this query to find only structure about a tables:
SHOW TABLE STATUS LIKE ’products’
If you wish to learn AutoIndex number, here's the comple code written in PHP:
<?php
$qquery = mysql_query("SHOW TABLE STATUS LIKE 'products'");
$row = mysql_fetch_assoc($qquery);
$next_increment = $row[’Auto_increment’];
echo "Next increment number is " . $row["Auto_increment"];
?>
Our free applications:
Custom Search
- ASP Chat Box
- Working with Array Remove An Item
- ASPNET Web Counter Free Open Source Code
- Beginning-Ajax-and-ASPNET-35
- How to upload images to mySQL within PHP
- Delete Files Online in ASP
- Video Interview With Roman Strobl
- Custom Paging in ASP Fast And Easy
- How to write and use a JavaBean My frst java bean
- Displaying Records From An Excel Database
- Paging Results in PHP
- Installing Sun Java System Application Server 9.1 in Solaris Zones
- Java SE 6 Performance White Paper
- Converting sceonds to hours minutes and seconds
- Encoding URL strings
- Easy Download Manager Free Version
- ASP Chat Box
- Writing Form Data to Text Files
- Paging Records in JSP
- What is Ecommerce and the Importance of Ecommerce
- Beginning-Ajax-and-ASPNET-35
- How to upload images to mySQL within PHP
- Simple XML RSS Parser
- Counting records in PHP mySQL
- ActiveNews Manager Freeware News Exchange Software
- How to write and use a JavaBean My frst java bean
- Paging Results in PHP
- Free User Registration Form
- A-timesaver-control-GridView
- ASPNET Web Counter Free Open Source Code
- Easy Download Manager Free Version
- ASP Chat Box
- Writing Form Data to Text Files
- Paging Records in JSP
- Beginning-Ajax-and-ASPNET-35
- How to upload images to mySQL within PHP
- Simple XML RSS Parser
- ActiveNews Manager Freeware News Exchange Software
- Counting records in PHP mySQL
- How to write and use a JavaBean My frst java bean
- Paging Results in PHP
- Free User Registration Form
- A-timesaver-control-GridView
- ASPNET Web Counter Free Open Source Code
- Comparing Dates