Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

php on IIS

Status
Not open for further replies.

mattmontalto

IS-IT--Management
Feb 26, 2010
68
US
I have what is probably a very basic question for anyone who knows php server matters. I am using a software called PhpRunner to develop a php application to enter data in an sql database. I have one field in particular (that I have noticed so far)... that will not display. the data type is nvarchar(max)... so I contacted phprunner support and they told me to upload the application to their demo server and the darn thing displays perfect. -- the only additional factor is that I noticed that when I exported the package to phprunner for testing (which by the way, obviously exports out the info to create the database tables and some data) is that it seems that the test info only has about 1 thousand of the databases records rather that the full 8000 that are in it... can anyone tell me if there is a server setting that I can look at here?... maybe a particular line in the web.config?

thanks in advance for the help
 
What is the display problem? Not displaying at all, displaying wrong?

You are aware the n in nvarchar means unicode? And that's not UTF-8, but UCS-2?

Bye, Olaf.
 
forum41 may offer more help.

Chris.

Indifference will be the downfall of mankind, but who cares?
Time flies like an arrow, however, fruit flies like a banana.
Webmaster Forum
 
thanks Olaf... to answer your question, nothing is displaying at all... I did not know that about the n in nvarchar.... there are some nvarchar fields that are displaying... though I cannot confirm if there are any nvarchar(max) fields displaying.... Trying to avoid having to change the column type if I can since it contains data already... had originally done the application in ASP and the column had been displaying fine, but have to make some major changes to the application and want to switch over to php.... Thanks for the help.... any other ideas are always welcome... thanks
 
thank you ChrisHirst.... I took your advise and re-posted in that forum... thank you
 
It's quite impossible to know what's going on, but as far as you said there is only partial data. How about using management studio (for MSSQL) or workbench (for MySQL) to see what data you really have raw, without going through the IIS at all? In the end it might not be an IIS or PHP problem at all, unless you fetch all data and have a timeout.

Looking into the database you can easily determine number of rows and structure of tables, eg also a missing field.

Bye, Olaf.
 
thanks olaf.... I have used sms and the data is there.... also I have created the app using ASP and the data shows fine for the field in question... I am not sure if it is so much the nvarchar part that is the problem.... I think its the (max) at the end causing the problem for php. not sure if there is any config change I can make to get that to show.... I have changed php versions... now running 5.6.16 but still no good....
 
If it is php related, it mainly is SQL Server driver related.

You should find out what SQL Server ODBC driver PHP uses and test, whether that fetches nvarcahr(max) correctly. Most probably not and most probably the solution then only is altering the database. You don't have much freedom what driver PHP uses, MS explicitly maintains one for PHP and different PHP versions can use upgraded ones, but you already tried that route.

In the end you have to change queries to eg CONVERT(varchar(8000),navarcharmaxfield. To get a field type the PHP MSSQL driver supports.

Bye, Olaf.
 
Thanks for all the help Olaf... I had come across info that php just doesn't like that (max) with the nvarhar... so I had experimented with using the CAST function of SQL to pull the query into my web application in a way it would handle (SELECT CAST(CAST([field] AS VARCHAR(8000)) AS TEXT) AS field FROM table)---- and it worked, but I felt that I have so many fields that are in that max format that it would be a lot of un-necessary processing overhead on the sql server, so I experimented with a test database and found that I could alter the field type to nvarchar(255) and it would not harm the data already in the field and php could then understand it... So I have now changed all the fields on the production database and I can resume with using php... so thanks for all the help... was a good academic exercise, but in the end, the simple structural changes seems to be the best way to do it. thanks

Matt M
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top