Jump to content

IF...ELSE syntax using NULL values...


Jim R

Recommended Posts

I have a column in my MySQL database "paid".  I have values of p for PayPal, c for check, and f for free.  Those who haven't paid the record is marked (NULL).

 

Right now my code is:

 

		if ($line['paid'] == 'y') {
	echo '.</center></td>';}
	else  {
	echo '</center></td>';}

 

That works pretty well for when I was just using those who paid vs. those who didn't.  However, I'm wanting my site to show who has paid vs. those who haven't, while my data table will easily show how they paid.

 

I either need an array or I need to reverse the IF...ELSE to say IF it's NULL do nothing, ELSE mark paid.

 

 

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.