I have a table which will select information from a database and display it, I'm wondering if anyone can provide a code for me to update a column on the click of a button?
Example Table: (Access=Boolean)
ID - Name - Access
---------------------------
1 - John - 1
---------------------------
2 - Ben - 1
---------------------------
3 - Terry - 0
---------------------------
My exisiting button is based on bootstrap,
<button type="button" id="passed" class="btn btn-success btn-flat"><i class="fa fa-check"></i></button>
<button type="button" id="insufficient" class="btn btn-danger btn-flat"><i class="fa fa-times"></i></button>
I was hoping for something like this, ONCLICK button1 Run $Allowed SQL
ONCLICK button2 Run $NotAllowed SQL
$allowed = mysqli_query($conn," UPDATE users SET Access = "1" WHERE id = '27' ");
$notallowed = mysqli_query($conn," UPDATE users SET Access = "0" WHERE id = '453' ");
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…