Tag: Microsoft

PHP MS SQL Truncated VarChar(255)

I don’t often have fields much longer than 256 char, but a web application I am working on makes use of varchar 512. I’m not really able to change the field to text as the PHP Docs suggest. MS SQL doesn’t allow the equal operator, and grouping on text fields, and it’s also very slow compared to a varchar which can make advanced queries very difficult. “Due to a limitation in the underlying API used by PHP (MS DBLib C API), the length of VARCHAR fields is limited to 255”

Basically, it appears that PHP is using some old C API from Microsoft and to get around this need to convert from varchar to text. Text by default, allows about 8,000 characters but changing this fairly simple in the php.ini


mssql.textlimit = 65536
mssql.textsize = 65536

Of course, you can also set it dynamically using ini_set.

ini_set("mssql.textlimit", '65536' );
ini_set("mssql.textsize", '65536' );

Hope this helps.

Browser Redirection – Yahoo Answers

I am having problems getting mozilla firefox to display my website correctly. It works fine on Internet Explorer. So I was thinking of making a mirror of the website that is made specifically for firefox browsers. Is it possible to code a website so that it detects what browser a visitor is using and them sends them to the correct mirror ?(i.e. index_firefox.html or index_ie.html)

Background Information
At the root of this question, there lies a huge problem that really never would have occured if browser creators followed the w3c recommendations. Microsoft and Netscape fought the original browser wars in the 1990s and throughout this time both created proprietary nonstandard tags and didn’t always follow the w3c recommendations. Eventually, Microsoft’s Internet Explorer won the war and Netscape disappeared into the oblivion to eventually become the Mozilla Project.

Mozilla Firefox, Opera, Safari and Chrome basically render almost exactly (99% of the time) the current w3c recommendations for css,html, and javscript and most of the draft recommendations are followed in the current builds of these browsers. Internet Explorer on the other hand, barely follows any of the w3c recommendations from even the year 2000. IE’s terrible rendering results in us having to perform significant testing and spend significant amounts of time doing IE6, IE7, and probably now IE8 hacks.

Problems With Potential Solution
I believe that redirecting based on a browser is a terrible idea, and should be avoided at all costs because of the potential doubling or trippling of work with regards to content.

Also, what happens if the browser doesn’t have javascript support of a user has turned it off? Chrome, Firefox,Opera, and Safari users would continue to be dished out a crap website that only works on some version of IE.

My Solution
Avoid the use of redirections for different browsers and instead developing a website that is 100% standards compliant and than start to add IE hacks as necessary.