So I have this mysql database on my homeserver.
I have to start developing the php-website which uses this database.
No comments or documentation .. really messed up.
Any tips on how to get started ?
Anything on how to understand the database structure ? Something to make it graphical or .. (just guessing now)
Anything really..
How to get to know a database?
Started by denarced, Jun 01 2009 04:12 AM
10 replies to this topic
#1
Posted 01 June 2009 - 04:12 AM
|
|
|
#2
Guest_Jordan_*
Posted 01 June 2009 - 05:09 AM
Guest_Jordan_*
You can use phpMyAdmin for database management. It is a web-based database administration tool and is really easy to use. As for getting to know MySQL, I suggest picking up a book and reading tutorials on the web. I've got MySQL 5.0 Certification Study Guide which isn't a bad book at all (although a bit boring).
#3
Posted 01 June 2009 - 05:11 AM
To start with, do you know SQL? That's that first place you have to go. If you're looking for a graphical interface, that suggests to me that you don't know how to interact with a database other than Access (which is junk).
#4
Posted 01 June 2009 - 05:14 AM
No book comes close to good old fashion practice imo! :thumbup:
#5
Guest_Jordan_*
Posted 01 June 2009 - 05:25 AM
Guest_Jordan_*
I agree but you must first learn how to practice.
#6
Posted 01 June 2009 - 05:33 AM
ok
so the following I have some knowledge of: SQL, phpMyadmin and PHP
My actual problem is that the database is huge(a few dozen tables)
Since I wanna learn how the db is built, I thought there propably is a better way then just go though every table and make the connections as I go .. huge job
so the following I have some knowledge of: SQL, phpMyadmin and PHP
My actual problem is that the database is huge(a few dozen tables)
Since I wanna learn how the db is built, I thought there propably is a better way then just go though every table and make the connections as I go .. huge job
#7
Posted 01 June 2009 - 07:19 AM
I would start with a list of tables and fields. Once that is done, you can look at sample data to get an idea of how everything hooks together. Usually field/table names will be a big clue.
#8
Posted 01 June 2009 - 07:24 AM
WingedPanther said:
I would start with a list of tables and fields. Once that is done, you can look at sample data to get an idea of how everything hooks together. Usually field/table names will be a big clue.
You wouldn't happen to know any handy way of listing them .. in mysql console or with php or whatever ..
#9
Posted 01 June 2009 - 08:16 AM
List all the tables, in that query for each table query and get 1 row from there and print it out and see the design or something
<?PHP
//CONNECT HERE!!
$query = mysql_query("SHOW TABLES");
while($row=mysql_fetch_assoc($query)) {
$one = array_pop($row);
$q = mysql_query("SELECT * FROM `$one` LIMIT 1") or die (mysql_error());
while($r=mysql_fetch_assoc($q)) {
$s .= "<hr>".$one."<br />";
$s .=print_r($r, true);
}
}
?>
<pre><?=$s?></pre>
#10
Posted 01 June 2009 - 08:24 AM
MySQL makes it easy to get info about the database from the console.
MySQL :: MySQL 5.0 Reference Manual :: 12.5.5.34 SHOW TABLES Syntax
MySQL :: MySQL 5.0 Reference Manual :: 12.5.5.5 SHOW COLUMNS Syntax
MySQL :: MySQL 5.0 Reference Manual :: 12.5.5.34 SHOW TABLES Syntax
MySQL :: MySQL 5.0 Reference Manual :: 12.5.5.5 SHOW COLUMNS Syntax
#11
Posted 01 June 2009 - 08:38 AM
BlaineSch said:
List all the tables, in that query for each table query and get 1 row from there and print it out and see the design or something
<?PHP
//CONNECT HERE!!
$query = mysql_query("SHOW TABLES");
while($row=mysql_fetch_assoc($query)) {
$one = array_pop($row);
$q = mysql_query("SELECT * FROM `$one` LIMIT 1") or die (mysql_error());
while($r=mysql_fetch_assoc($q)) {
$s .= "<hr>".$one."<br />";
$s .=print_r($r, true);
}
}
?>
<pre><?=$s?></pre>this looks about right
many thanks


Sign In
Create Account


Back to top










