aebstract Posted February 12, 2010 Share Posted February 12, 2010 <?php $server = 'ww26.empiredatatech.com'; $link = mssql_connect($server, 'outlaw', 'out98765law'); $query = mssql_query("SELECT * FROM aspnet_Membership"); while($r=mssql_fetch_array($query)){ echo "<pre>"; print_r($r); echo "</pre>"; echo "hi"; } ?> The question I have here is, what content can you place inside print_r() that will cause a white page? I have some tables that show and some that will produce a white page, so there has to be some sort of character or something that I need to strip out to be able to display my results? Any ideas? Quote Link to comment https://forums.phpfreaks.com/topic/191879-print_r/ Share on other sites More sharing options...
bugcoder Posted February 12, 2010 Share Posted February 12, 2010 probably there is nothing in fetched array. try to see the page view source too. Quote Link to comment https://forums.phpfreaks.com/topic/191879-print_r/#findComment-1011379 Share on other sites More sharing options...
PFMaBiSmAd Posted February 12, 2010 Share Posted February 12, 2010 Your query is either failing (due to things like a table name that does not exist, in which case $query will contain a FALSE value) or the query is returning zero rows (in which case mssql_fetch_array() will return a FALSE value and the WHILE() loop will be skipped over.) Real code (code that will tell you when and why it is failing) must test if the query worked ($query is not a FALSE value) and should use mssql_num_rows() to test how many rows were returned before ever executing a WHILE() loop to fetch data from the result set. Quote Link to comment https://forums.phpfreaks.com/topic/191879-print_r/#findComment-1011380 Share on other sites More sharing options...
jaiffed Posted February 12, 2010 Share Posted February 12, 2010 try this $server = 'ww26.empiredatatech.com'; $link = mysql_connect($server, 'outlaw', 'out98765law'); $query = mssql_query("SELECT * FROM aspnet_Membership"); $fel=mysql_num_fields($result); $result= mysql_query($query,$link) or die(""); $nro=mysql_num_rows($result); while($r=mssql_fetch_array($query)){ echo "<pre>"; print_r($r); echo "</pre>"; echo "hi"; } Quote Link to comment https://forums.phpfreaks.com/topic/191879-print_r/#findComment-1011383 Share on other sites More sharing options...
aebstract Posted February 12, 2010 Author Share Posted February 12, 2010 $query = mssql_query("SELECT * FROM aspnet_Membership"); if(mssql_num_rows($query) > 0){ while($r=mssql_fetch_array($query)){ echo "<pre>"; print_r($r); echo "</pre>"; } } else { echo "broken"; } broken is displayed on the page. The table does exist and there is information in it.. I know it exists because it shows up when I display all tables in my database and there has to be information because that is the table that stores user's passwords. jaiffed: that gives me a white page as well Quote Link to comment https://forums.phpfreaks.com/topic/191879-print_r/#findComment-1011388 Share on other sites More sharing options...
PFMaBiSmAd Posted February 12, 2010 Share Posted February 12, 2010 Echo mssql_get_last_message() as part of your error reporting logic to find out any additional information. Is that the only or the first mssql_query() on the page, because - Note: If the query returns multiple results then it is necessary to fetch all results by mssql_next_result() or free the results by mssql_free_result() before executing next query. Quote Link to comment https://forums.phpfreaks.com/topic/191879-print_r/#findComment-1011389 Share on other sites More sharing options...
aebstract Posted February 12, 2010 Author Share Posted February 12, 2010 Only query; Unicode data in a Unicode-only collation or ntext data cannot be sent to clients using DB-Library (such as ISQL) or ODBC version 3.7 or earlier. Quote Link to comment https://forums.phpfreaks.com/topic/191879-print_r/#findComment-1011392 Share on other sites More sharing options...
PFMaBiSmAd Posted February 12, 2010 Share Posted February 12, 2010 This is just a guess, but it sounds like the php/mssql client library (the client that php uses to communicate with the database) is not the latest version and is not compatible with the database server. Quote Link to comment https://forums.phpfreaks.com/topic/191879-print_r/#findComment-1011396 Share on other sites More sharing options...
aebstract Posted February 12, 2010 Author Share Posted February 12, 2010 I'm assuming that's all on the host's end of things? They are actually really terrible and I would not doubt that it isn't up to date at all. This could be a big issue, because I noticed it doing this with a few other tables.. some tables show though. =[ With that being said, is there anything at all imaginable that might work to get this information? Quote Link to comment https://forums.phpfreaks.com/topic/191879-print_r/#findComment-1011397 Share on other sites More sharing options...
aebstract Posted February 12, 2010 Author Share Posted February 12, 2010 Is there a way for me to change all ntext columns in a specific table to text columns through a query? In the php manual there is a fix, if I can get the column types changed. Quote Link to comment https://forums.phpfreaks.com/topic/191879-print_r/#findComment-1011439 Share on other sites More sharing options...
aebstract Posted February 12, 2010 Author Share Posted February 12, 2010 This topic isn't solved but it's a sql issue now. Quote Link to comment https://forums.phpfreaks.com/topic/191879-print_r/#findComment-1011441 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.