Type mismatch: '[string: ""]'

E

exsuscito

After about 30 minutes of frustration I finally discovered what was
causing a general 500 internal server error and to my surprise it was
something I seem to always take for granted for its simplicity. A type
mismatch error trying to compare a string to a numerical value, which
is something that PHP has no problem or qualms with. However, this
continuous problem continues to haunt me year after year and has
brought me to tears with frustration. This is the line that raises the
error:

nID = Request("ID")
If IsNull(nID) Or IsEmpty(nID) Or nID = 0 Then
.... (and so on)

In the past I've written a function 30 lines long that compares values
by confirming value types of the variables first, but I would rather
put a gun to my head than do that. Since there are obviously other
bright PHP and ASP developers out there that constantly trip over this
problem, I would like to know your suggestions or methods of working
around this.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,021
Latest member
AkilahJaim

Latest Threads

Top