Solved

is_null not working

Posted on 2008-10-14
4
428 Views
Last Modified: 2013-12-13
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
Comment
Question by:Isaac
  • 2
  • 2
4 Comments
 
LVL 142

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 22713830
what about:
if ( $row["postForm"] == null)) 

Open in new window

0
 
LVL 5

Author Comment

by:Isaac
ID: 22713851
That did not work either
0
 
LVL 5

Author Comment

by:Isaac
ID: 22713866
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
 
LVL 142

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 500 total points
ID: 22713948
if ( $row["postForm"] . "" != "1"))  
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

Consider the following scenario: You are working on a website and make something great - something that lets the server work with information submitted by your users. This could be anything, from a simple guestbook to a e-Money solution. But what…
This article will explain how to display the first page of your Microsoft Word documents (e.g. .doc, .docx, etc...) as images in a web page programatically. I have scoured the web on a way to do this unsuccessfully. The goal is to produce something …
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now