Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

MYSQL sets

Explorer ,
Jul 08, 2011 Jul 08, 2011

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

TOPICS
Server side applications
426
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Jul 08, 2011 Jul 08, 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"; } ?>

Translate
Community Expert ,
Jul 08, 2011 Jul 08, 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"; } ?>

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jul 13, 2011 Jul 13, 2011
LATEST

You can safely assume that yes.

It looks as if it will work perfectly. Cheers

T

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines