PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
here is my little code. When i echo this it returns a list of database. how can i click on the list of result and save it to a variable?
once the list of databases are outputed, i would like to be able to click on a database name and show the tables in that database.
help somone please. examples would be nice. Thank you.
jpaloyo wrote:here is my little code. When i echo this it returns a list of database. how can i click on the list of result and save it to a variable?
once the list of databases are outputed, i would like to be able to click on a database name and show the tables in that database.
help somone please. examples would be nice. Thank you.
$database_query = mysql_query("show databases");
while ($row = mysql_fetch_row($database_query))
{
echo $row[0] . "<br>";
echo $row[1] . "<br>";
echo 'View <a href=?db=' .$row[0]. '>This Database</a>';//something like this i would guess
}
after this,you would need to set up and action in your main to get the result name and then do a SELECT * FROM dbname. Since i dont usually do this using the naumbers,im not really sure how to go past that.
Essentially, you just want to feed a given value from the initial output to a new query and spit out the results. That first echo is somewhat messy though...