Jump to content

view all db info


aebstract

Recommended Posts

I've never worked in microsoft sql, so I am not sure if it is in any way similar to mysql or completely different. I'm also somewhat limited on support and what I have access to. I can run php and have full ftp access. I can probably run .net as well, as the site is running on dotnetnuke and from what I've read that is based off of .net. I have no idea whatsoever how to even look at .net, so I would prefer staying with php.

 

Is there a way to use the sql server info and view all database information? I hope it is structured somewhat similar to mysql, as in having tables, columns/rows, etc. I don't know what tables I have, don't know anything really. I'm going to have to start working on a huge port out and port in to a new system (which will be mysql) and this is my first step. Any advice/info/tips is awesome. Thanks!

Link to comment
Share on other sites

Okay, I'm sort of stuck on actually displaying the information.

<?php

$server = '1';

$link = mssql_connect($server, '2', '3');

if (!$link) {
    die('Something went wrong while connecting to MSSQL');
}

$query = mssql_query("SELECT * FROM information_schema.tables");
while($r=mssql_fetch_array($query))
{

echo mssql_result($query);

}




?>

 

Blank page, I'm assuming I'm connected as I get no error and this is the method that was used as demonstration in the php manual. So that brings me to actually displaying the information, which I usually would do a while and loop through each row of information in a table, though this is obviously different and I'm not looping through like that. How can I echo out the information so I can see it?

Link to comment
Share on other sites

This is array formatted nicely. You just have to view source to see it ;)

I used print_r only as an example. $r is an array, and you can display it however you wish. You can also save results to a file, for future reference.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.