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
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

 

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.