• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 444
  • 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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: CompTIA Healthcare IT Tech

This course will help prep you to earn the CompTIA Healthcare IT Technician certification showing that you have the knowledge and skills needed to succeed in installing, managing, and troubleshooting IT systems in medical and clinical settings.

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