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
https://forums.phpfreaks.com/topic/215394-ifelse-syntax-using-null-values/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.