Jump to content

Recommended Posts

I'm kind of confused, maybe someone knows why this would be acting the way it is. So, from the previous post, I have gathered information so I know what tables I have in my database. Now I'm wanting to go in to certain tables and look at what columns/information are in them.

 

$query = mssql_query("SELECT * FROM ordnn_Users");
while($r=mssql_fetch_array($query)){
echo "<pre>";
print_r($r);
echo "</pre>";
}

 

This will give me:

 

Array
(
    [0] => 1
    [userID] => 1
    [1] => OR_host
    [username] => OR_host
    [2] => Host
    [FirstName] => Host
    [3] => Account
    [LastName] => Account
    [4] => 1
    [isSuperUser] => 1
    [5] => 
    [AffiliateId] => 
    [6] => host
    [Email] => host
    [7] => Host Account
    [DisplayName] => Host Account
    [8] => 0
    [updatePassword] => 0
)

Array
(
...so on and so on

 

Now, I want to try this with another table:

 

$query = mssql_query("SELECT * FROM aspnet_Membership");
while($r=mssql_fetch_array($query)){
echo "<pre>";
print_r($r);
echo "</pre>";
}

 

This returns a blank page.

My original query that gave me my list was:

 

$query = mssql_query("SELECT * FROM information_schema.tables");

while($r=mssql_fetch_array($query))
{
echo "<pre>";
print_r($r[2]);
echo "</pre>";
}

 

Which gave me a lot of results, but here are the two sections that contain the two tables I have referenced so far:

 

Array
(
    [0] => outlawracingcom
    [TABLE_CATALOG] => outlawracingcom
    [1] => dbo
    [TABLE_SCHEMA] => dbo
    [2] => ordnn_Users
    [TABLE_NAME] => ordnn_Users
    [3] => BASE TABLE
    [TABLE_TYPE] => BASE TABLE
)



Array
(
    [0] => outlawracingcom
    [TABLE_CATALOG] => outlawracingcom
    [1] => dbo
    [TABLE_SCHEMA] => dbo
    [2] => aspnet_Membership
    [TABLE_NAME] => aspnet_Membership
    [3] => BASE TABLE
    [TABLE_TYPE] => BASE TABLE
)



 

 

Kinda has me confused

Link to comment
https://forums.phpfreaks.com/topic/191809-some-tables-have-results-some-dont/
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.