My website is on a server which actually hosts many websites. I recently created a php page that would list the databases I have on my site. (code below)
However the page is listing ALL databases on ALL sites which are hosted on that server (no just for my domain).
I had a little bit of a "security freak out" moment...but it seems I can only see these other databases - and not connect to them. (For the moment I'll assume that's the case with my databases as well).
Since "virtual servers" are extremely common - surely someone else has seen this. So, I have a few questions:
1) Is there a way to make the query list only the databases within my virtual server (domain)?
2) Is this a configuration problem with mySQL on this server?
Thanks in advance,
Dave
$dbresult = mysql_list_dbs($link);
$num_of_db = mysql_num_rows ($dbresult);
print "Databases:<BR>";
$i = 0;
while ($i < $num_of_db) {
$db_names[$i] = mysql_tablename ($dbresult, $i);
print "$db_names[$i]<BR>";
$i++;
}