|
I have created a php script that list the databases on my server. I want the results to appear next to a radio button so when that button is chosen it will jump to another php script. I needed help getting started, I can't figure out how to have the results appear next to the radio button and jump to the other script. Example
*database1
*database2
*database3
so if I click on the radio button next to database1 it would jump to another script that would show the tables in that database.
I think the answer lies in this line:
$db_list .= "<input type='radio' name='dbnames' value=$db_names[$db_num]><br \>";
it displays the radio button but not the name of the database
Just a student trying to learn
This is what I have to far:
<?php
$connection = @mysql_connect("localhost", "username", "password")or die(mysql_error());
$dbs= @mysql_list_dbs($connection) or die(mysql_error());
$db_list ="";
$db_num =0;
while($db_num < mysql_num_rows($dbs)){
$db_names[$db_num] = mysql_tablename($dbs, $db_num);
$db_list .= "<input type='radio' name='dbnames' value=$db_names[$db_num]><br \>";
$db_num++;
}
$db_list .= "";?>
<HTML>
<head>
<TITLE>MySql Databases</TITLE>
</head>
<BODY>
<p><STRONG>Databases on localhost</STRONG>:</p>
<? echo "$db_list"; ?>
</BODY>
</HTML>
Last edited by cedtech23 : 07-20-2004 at 12:05 AM.
Reason: provide more info
|