Skip to main content
Inspiring
July 8, 2011
Answered

MYSQL sets

  • July 8, 2011
  • 1 reply
  • 422 views

Hi all,

I'm creating an admin area for a client and I have a field in the user table which is a set with the option of 'y' 'n'. If the user has 'y' then I want them to be able to see a couple of buttons that the user with 'n' cannot see. How can I go about this? I'm working in PHP by the way.

Cheers

Tom

This topic has been closed for replies.
Correct answer Ben M

Can we safely assume you have queried the necessary data into an array with your query?

If so, where you want this one particular button to go, you just need to use an if statement:

<?php if ($QueryArray['fieldx'] == "y" ) { echo "My Button"; } ?>

1 reply

Ben MCommunity ExpertCorrect answer
Community Expert
July 8, 2011

Can we safely assume you have queried the necessary data into an array with your query?

If so, where you want this one particular button to go, you just need to use an if statement:

<?php if ($QueryArray['fieldx'] == "y" ) { echo "My Button"; } ?>

Inspiring
July 13, 2011

You can safely assume that yes.

It looks as if it will work perfectly. Cheers

T