×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

php on IIS

php on IIS

php on IIS

(OP)
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

RE: php on IIS

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.

RE: php on IIS

(OP)
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

RE: php on IIS

(OP)
thank you ChrisHirst.... I took your advise and re-posted in that forum... thank you

RE: php on IIS

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.

RE: php on IIS

(OP)
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....

RE: php on IIS

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.

RE: php on IIS

(OP)
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

RE: php on IIS

I'm unsure, if this isn't fixed by now, since it is a well knonw old problem, eg here is a bug report and hotfix mentioned:
https://bugs.php.net/bug.php?id=54169

But since it's solved for you with nvarchar(255) that's fine.

Bye, Olaf.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close