Re: web database template
| From: | mattias at thorslund dot us | Date: | Tue, 14 Feb 2006 18:24:27 +0000 |
| Subject: | Re: web database template | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-230382@lists.php.net to get a copy of this message | ||
Quoting reiner <reiner@tm.minbas.cu>:
Hello friend I am new in PHP and Mysql a have a good background in sql server I need to create a mysql database but I am new in web application so can you help me to find a database template in mysql?I think you're asking how you can get the table meta-data from a MySQL server? Well, unlike MS SQL Server, there isn't a built-in graphical presentation for this, though I imagine there are third-party tools. To explore you MySQL database with PHP (if you don't want to get your hands dirty at the command prompt, described below), try PHPMyAdmin (http://www.phpmyadmin.net/). PHP also have programmatic ways to explore table structure. Look into mysql_list_fields(), for a start: http://us3.php.net/manual/en/function.mysql-list-fields.php I'm unfamiliar with mysqli but I'm confident that table meta data can be extracted that way too (and probably better). Command line approach (non-PHP, shame on me...): From the MySQL prompt, after you log in and select your database (with USE <database_name>), do: SHOW TABLES; ... and you'll see a list of all the tables in that database. To see the structure of a table, do: DESCRIBE <table_name>; or: SHOW CREATE TABLE <table_name>; The second of these will give you a CREATE TABLE sql statement which would create that table. Best, Mattias Thorslund, http://www.activeagenda.net