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.

Website Compatibility Testing (Chrome,IE,FireFox,Opera)

When dealing with clients, prospects, or even employers I won’t generally mention specific browsers that I test my websites in and haven’t really had the question come up much. I honestly would prefer my clients / employeers spend money on something else rather than achieving perfect pixel positioning in every browser, but if they want to achieve this than I won’t complain too much! :-)

For the most part, Chrome, Firefox, and Opera are extremely similar in their rendering ( ~ 100% standards compliance and often have implemented a lot of the draft recommendations) on Windows and seem to be only slightly different at rendering from their respective Windows version on Linux and Macs.

Google Chrome
I haven’t had many occasions where Firefox has rendered differently than Chrome or Chrome has rendered differently than Opera. I usually just install the latest version on a VM for Vista, and Windows XP and haven’t really worried about the old versions as they have rendered almost identically.

Internet Explorer
Normally, you are unable to have multiple versions of Internet Explorer installed on the same operating system. When you upgrade Internet Explorer from 6 to 7 or from 7 to 8 even, most of the actual updates are occuring in the Windows folder.

A very clever individual discovered there was a method of getting multiple versions of IE (multi_ie) working side by side, unfortunately, this doesn’t seem to work any more in XP SP3, or in Windows Vista which i am stuck using at times.

Surprisingly, I found out that Microsoft offers the Internet Explorer Application Compatibility VPC Images which is a group of virtual harddrives created for Microsoft Virtual PC. There’s a whole selection of machine which include: IE6, IE7 (for Vista and XP), IE8 (for Vista and XP) which will definitely help me in my testing and I hope that you will find it helpful too.

Mozilla Firefox
Firefox is extremely strong in standards compliance and seems to account for about 20% of the internet browsers in use especially outside of business. Finding and installing old versions of Firefox isn’t overly difficult, although I do use oldapps.com for versions of browsers and have done very well so far. Typically, I use .0 and .5 releases of Firefox for testing as there’s almost no way I could realistically evaluate my websites in every version of the browser and I haven’t found there to be too many differences in minor releases.

Webdevelopers have a couple of options for testing with Firefox, we can use the standalone / portable ones or install multiple versions instead of using several virtual machines.Installing multiple versions of Firefox is actually fairly easy, as long as you follow the directions: multiple versions of firefox

Opera
Opera has always sort of been an interesting browser as it outlasted Netscape even though it also fought through the browser wars. Opera also used to be shareware and is now free for the PC. Opera is probably one of the better browsers out there as it is sleek, quick, standards compliant, and has some of the better multiple tab handling. Unless asked directly about, I don’t make it a habit of testing in Opera even though I personally enjoy the browser.

Slider by webdesign