Jump to content

I am missing a little thing somewhere


pioneerx01

Recommended Posts

I am running a search query from MYSQL and it works, but now I want to get a little custom.

 

I am selecting one field, out of many called paid1 which in database is either Yes or No. I want to do this: if paid1 is NO display Pay Now and everything else display Yes. I want this to be under new heading of paid1b. So the code should look something like this:

 

$paid1b= if(['paid1'}==No){echo "Pay Now";} else {echo "YES";}

 

But I am missing something somewhere. What is it?

Thanks

Link to comment
https://forums.phpfreaks.com/topic/221598-i-am-missing-a-little-thing-somewhere/
Share on other sites

echoing text into a variable?

 

With your code I would write it like this:

if({'paid1'} == no){
$paid1b = "Pay Now";
}else{
$paid1b = "Yes";
}
echo $paid1b

 

Don't quote me on the formatting of that above code, I'm always getting confused between () [] {}, and the needs for them in different situations, but the gist of what I've written should work..

 

Hope that helps

Denno

 

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.