aebstract Posted March 4, 2010 Share Posted March 4, 2010 <?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. Quote Link to comment https://forums.phpfreaks.com/topic/194178-changed-database-context-to-databasename/ Share on other sites More sharing options...
Zane Posted March 4, 2010 Share Posted March 4, 2010 my guess is that you haven't selected your database... look at mssql_select_db() Quote Link to comment https://forums.phpfreaks.com/topic/194178-changed-database-context-to-databasename/#findComment-1021646 Share on other sites More sharing options...
aebstract Posted March 4, 2010 Author Share Posted March 4, 2010 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 Quote Link to comment https://forums.phpfreaks.com/topic/194178-changed-database-context-to-databasename/#findComment-1021649 Share on other sites More sharing options...
aebstract Posted March 5, 2010 Author Share Posted March 5, 2010 I really need this figured out soon this morning. Quote Link to comment https://forums.phpfreaks.com/topic/194178-changed-database-context-to-databasename/#findComment-1021917 Share on other sites More sharing options...
aebstract Posted March 6, 2010 Author Share Posted March 6, 2010 Anyone have any idea whatsoever of what I can do? I need access to this like right now. Quote Link to comment https://forums.phpfreaks.com/topic/194178-changed-database-context-to-databasename/#findComment-1022184 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.