Re: web database template

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Quoting reiner <reiner@xxxxxxxxxxxx>:

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

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux