identifying NULL or empty variable
Posted: Sat Apr 07, 2007 10:00 am
Hi there. I am using AJAX/javascript to call a php script using POST method. I create the parameters string in javascript and pass it to the http_request.send() function.
In the php script i expect from 1 to 6 variables and that depends on the javascript. Moreover i am trying to identify in the script if the variables where passed or not.
I am using
but doesnt seem to work. Even if area2 variable was not at all at the parameters string, it doesnt recognise it as NULL, therefor it goes on with what is inside the IF statement and then the sql querry crashes...Any ideas on how to identify if a variable is passed to the parameters string or not??
thanks
In the php script i expect from 1 to 6 variables and that depends on the javascript. Moreover i am trying to identify in the script if the variables where passed or not.
I am using
Code: Select all
if(area2 != NULL) {$sql .= " OR $area2 = areas.id"; $FLAG=1;}thanks