I’m trying to make an if statement to enable and disable user account in href link but I want the link display Disable if the Query return active = 1 and enable if the query return 0.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Very unclear what you want exactly. You should rewrite the question more clearly and provide more detail.
At a guess though, is this what you are looking for?
UPDATE 1 Edited to include code you posted above. Add a return statement to your member_enable function to return number of rows as mentioned in above answer
UPDATE 2
Sounds like you simply need to retrieve the relevant fields from the DB on page load, loop through them printing out the info and the link, and then, when a disable/enable link is pressed, load a script which enables/disables the account and then returns the admin to the user management page. By reloading the management page, the links will change to the appropriate text as it will be using the updated database values.