Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 440
  • Last Modified:

is_null not working

What's the best way in php to check if a db column is null b/c IS_NULL() is not working for me.
The database is SQL Server 2000
<?php
								if (is_null($row["postForm"])) <-- not working
								{
									echo "<a href=trans.php?travelID=".$row["travelID"]."&destination_id=".$row["destinationID"]."&type=post>Please Complete.</a>";
								}
								else
								{
									echo "VIEW completed form";
								}
							?>

Open in new window

0
Isaac
Asked:
Isaac
  • 2
  • 2
1 Solution
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
what about:
if ( $row["postForm"] == null)) 

Open in new window

0
 
IsaacSharePoint Client Side DeveloperAuthor Commented:
That did not work either
0
 
IsaacSharePoint Client Side DeveloperAuthor Commented:
Also, the data type for that column is "bit" so the default is supposed to be zero but it shows null.
That's why I'm checking if it's no.  It's just a "Yes" or "No" column.
0
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
if ( $row["postForm"] . "" != "1"))  
0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now