Assuming you DON'T know what DB youre using,

is there a way to find out what DB you're using with mysql/php ??

    I don't know if there is a surefire way but if you run a query 'SHOW TABLES' the coluim reutrned is named in the form 'tables_in_testdb'. So you could run the query fetch_array the first row and extract the key . . .

      14 days later

      ok, have

      $qcdb=mysql_query("SELECT DATABASE()");

      now how do I show the info ?

        Write a Reply...