Shakir Posted October 31, 2013 Share Posted October 31, 2013 <?php //I WANT TO DISPLAY THE TABLES NAME INSIDE THE DATABASE //How to write the query for it //============================================================================== //You have to Start Session to Use the Session Variable at that page //============================================================================== session_start(); //$Server = $_SESSION['Server']; //$User = $_SESSION['User']; //$Pass = $_SESSION['Pass']; $DB = $_SESSION['DB']; echo $DB; //============================================================================== //$query = mssql_query('USE your_database SELECT name FROM sys.tables'); $query = mssql_query('USE "$DB" SELECT name FROM sys.tables'); print_r($query); Quote Link to comment Share on other sites More sharing options...
vinny42 Posted October 31, 2013 Share Posted October 31, 2013 My first question would be: what are you working on; why do you now know the names of the tables? The code you posted makes no sense, did you read the PHP manual section about working with mssql? See: http://www.php.net/manual/en/function.mssql-query.php Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.