...

php:If a field in a mysql table is blank then...

sir pannels
10-24-2002, 02:51 PM
hey.
ok if worked out a script for displaying a few links acording to the contents of a field...in the field will be one word.... but what im trying to do now is an if statement.. so befor it prints the info it see is the field is blank...
in english...
if cell_name empty
print somestuff
else print some other stuff

ok i know how to do if else statements in php... the thing i need help with is seing if the filed is empty or not..
any ideas?
cheers :thumbsup:
P

Spookster
10-24-2002, 03:25 PM
check the result set for null values

sir pannels
10-24-2002, 06:22 PM
hey thanks spook.
i did it not long after this post .. i just made the if see if it had the word "none" in the cell and set the default to none
thanks tho man:)
P

Jeewhizz
10-25-2002, 01:45 AM
assume the value of a cell is set to $var:


if(trim($var)=='')
{
echo "Nothing found";
}
else
{
echo $var;
}


Jee



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum