Skip to content
Advertisement

Show button whose value is present in database else hide the button

I have 5 columns in database id, a1, b1, c1 and d1. I want to show button a if the value in database for a1 is not there and if two values eg. c1 and b1 is present in database i want to show buttons for a and d.

Simple thing I want to show the button for that if there is no value in database.

I have tried the it by entering 16 conditions but it take a lot of time and space.

JavaScript

Is there any other way to do this.

Thanks in advance

Advertisement

Answer

here is the logic you can try.if you are going for specific row

step1: select the row according to id

JavaScript

step2: fetch a assosiative array.

JavaScript

step2: check for the condition.

JavaScript
User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement