Thanks a lot :)
I am writing a small offline apps to convert some data of multiple tables into one table with some middle processing and changes hence no problem of EXPOSURE so please guide me further.
Basically I am also new to JS Hence cannot undersatnd how to pass to and fro from PHP& JS.
Thanks for gre8 clue for onchange() event.
The specific prbolem with me is that I am stuck with >> How to choose SELECTED value (of listed database names) and pass on to the another dropdown which list the TABLES on SELECTED DB,
Thanks
Sunipro
Ok, if you're new both to PHP and MySQL, it is a good thing to start from the reference manuals of both PHP and MySQL. If you are new to html a good way to start is for example W3Schools.com. I will outline how it is made, still you have to figure it out.
1. in order to access the DB with full privilege you should login as root. This means that PHP should post to MySQL root as user and rootpass as password to have all privileges.
2. If connection is successful, your mysql querry should be smth like this
[php]$query = mysql_query('show databases;');[/php]
This will show all databases available on the server.
3. The results you should load in a element as s. This is done using some loop as foreach, while or for...depends on your choice.
Note in order to submit the form without GO button, you should make it like this
[html][/html]
For each option you should insert a value like this:
e.g. you have loaded your results from the querry into $result wich holds the databases.Option should look like this
[php]echo ''.result.'';[/php]
4. When selected, the value will be submitted to next php script, wich will make another query using one of the following methods.
A. [php]$selectDB=mysql_select_db($option.value.from.previous.page);[/php]
B. [php]$query=mysql_query('show tables;');[/php]
OR
[php]$query = mysql_query('show tables from '.$option.value.from.previous.page.';');[/php]
5. Load the results the same way you loaded the result from the first query.
6. Now, I don't get it clear - if you want to view the table content or view the table structure.
A to view the table structure folow the above instructions to make the query, however the query should be like this:
[php]$query=mysql_query('describe table.'$table_name_from_previoust_page'.;');[/php]
OR
B. To view all records, your query should be:
[php]$query = mysql_query('SELECT * FROM'.$table_name_from_previous_page.';');[/php]
That's all. You should learn yourself how to display the results on your page. If I give you the complete script as it should look like, you'll never learn a thing, so forgive me not giving you all ready-made. ;)
Good luck with learning!