Author Topic: Changed database context to 'databasename'  (Read 3811 times)

0 Members and 1 Guest are viewing this topic.

Offline aebstractTopic starter

  • Devotee
  • Posts: 1,103
    • View Profile
Changed database context to 'databasename'
« on: March 04, 2010, 04:00:34 PM »
<?php

$query 
=
mssql_query("

SELECT UserID
FROM ordnn_Forum_Posts


"
);




if(
mssql_num_rows($query) > 0){
while(
$r=mssql_fetch_array($query)){


echo 
"<pre>";
print_r($r);
echo 
"</pre>";


}
} else {
echo 
mssql_get_last_message();
}


?>


Okay, I'm just trying to simply grab and display the UserID from ordnn_Forum_Posts. I'm getting this error:
Changed database context to 'outlawracingcom'.


I've looked around a little bit and noticed some references saying it is just a message not an actual error. If this was the case, I would be able to at least see/get my information. I just get the error and a white page to follow it.
There is an area of the mind that could be called unsane, beyond sanity, and yet
not insane. Think of a circle with a fine split in it. At one end there's
insanity. You go around the circle to sanity, and on the other end of the
circle, close to insanity, but not insanity, is unsanity.

Offline Zane

  • Global Moderator
  • Fanatic
  • *
  • Posts: 3,896
  • Gender: Male
    • View Profile
Re: Changed database context to 'databasename'
« Reply #1 on: March 04, 2010, 04:04:02 PM »
my guess is that you haven't selected your database...

look at mssql_select_db()

Want to thank me?  Contribute to my PayPal piggy-bank

Offline aebstractTopic starter

  • Devotee
  • Posts: 1,103
    • View Profile
Re: Changed database context to 'databasename'
« Reply #2 on: March 04, 2010, 04:13:34 PM »
I'm connected, if I wasn't connected the first thing is it wouldn't be saying 'outlawracingcom' because it wouldn't have a connection to pull that value.

This is at the top:
$server 'ww26.empiredatatech.com';
$link mssql_connect($server'user''pass');

Which, no it isn't using mssql_select_db(), but this code below works perfect:


<?php

$server 
'ww26.empiredatatech.com';
$link mssql_connect($server'outlaw''out98765law');




$query =
mssql_query("

SELECT ordnn_Users.userid, ordnn_Users.username, ordnn_Users.email, ordnn_UserPortals.CreatedDate
FROM ordnn_Users
JOIN ordnn_UserPortals ON ordnn_Users.userid = ordnn_UserPortals.userid

"
);




if(
mssql_num_rows($query) > 0){
while(
$r=mssql_fetch_array($query)){

$r[] = '00000000006xrqeiww
i1cjyo000000
qlaq52000000
qlaq52000000'
;

$r[] = crc32(strtolower($r[2])) . strlen($r[2]);

$r[0] = $r[0]+200;
echo 
"<pre>";
print_r($r);
echo 
"</pre>";


}
} else {
echo 
mssql_get_last_message();
}


?>





edit:

$server 
'ww26.empiredatatech.com';
$link mssql_connect($server'user''pass');
mssql_select_db('outlawracingcom'$link);


This doesn't change the error one bit :(
« Last Edit: March 04, 2010, 04:17:25 PM by aebstract »
There is an area of the mind that could be called unsane, beyond sanity, and yet
not insane. Think of a circle with a fine split in it. At one end there's
insanity. You go around the circle to sanity, and on the other end of the
circle, close to insanity, but not insanity, is unsanity.

Offline aebstractTopic starter

  • Devotee
  • Posts: 1,103
    • View Profile
Re: Changed database context to 'databasename'
« Reply #3 on: March 05, 2010, 08:00:21 AM »
I really need this figured out soon this morning.
There is an area of the mind that could be called unsane, beyond sanity, and yet
not insane. Think of a circle with a fine split in it. At one end there's
insanity. You go around the circle to sanity, and on the other end of the
circle, close to insanity, but not insanity, is unsanity.

Offline aebstractTopic starter

  • Devotee
  • Posts: 1,103
    • View Profile
Re: Changed database context to 'databasename'
« Reply #4 on: March 05, 2010, 08:02:16 PM »
Anyone have any idea whatsoever of what I can do? I need access to this like right now.
There is an area of the mind that could be called unsane, beyond sanity, and yet
not insane. Think of a circle with a fine split in it. At one end there's
insanity. You go around the circle to sanity, and on the other end of the
circle, close to insanity, but not insanity, is unsanity.