Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.
Moderator: General Moderators
AliasBDI
Forum Contributor
Posts: 286 Joined: Fri Nov 15, 2002 10:35 am
Location: Spring, TX, USA
Post
by AliasBDI » Fri Oct 01, 2004 5:58 pm
I am trying a basic IF clause for a specific column. I want it to not show if the column in the record is empty. I tried this but it does not work. Any ideas?
Code: Select all
<?php
if ($row_detailsDoctrine['notes']=="NOT NULL"){ ?>
John Cartwright
Site Admin
Posts: 11470 Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:
Post
by John Cartwright » Fri Oct 01, 2004 6:10 pm
its actually if $var != NULL
but instead you should just do if (!empty($var))
Joe
Forum Regular
Posts: 939 Joined: Sun Feb 29, 2004 1:26 pm
Location: UK - Glasgow
Post
by Joe » Fri Oct 01, 2004 7:26 pm
Code: Select all
<?php
if (!empty($row_detailsDoctrine['notes'])){ ?>
AliasBDI
Forum Contributor
Posts: 286 Joined: Fri Nov 15, 2002 10:35 am
Location: Spring, TX, USA
Post
by AliasBDI » Sun Oct 03, 2004 9:33 pm
Joe, that nailed it. Thanks a bunch!