Adorius Black
Advanced OT User
- Joined
- Mar 31, 2020
- Messages
- 303
- Solutions
- 3
- Reaction score
- 180
Hi I wrote short code for reports. This code takes info from database and show on webpage all reports. I created in table "player_reports" column "solved" which has automaticaly value 0. Code written below show on webpage all reports with value "solved=0". I created also button "Solve!" which is displayed with every report on webpage. I would like this button to be able to change the value of the exact report from 0 to 1 after clicking on it (solved set to 1). So after click on button of exact report change "solved" "value from 0 to 1 and in this case report will be marked as solved and will not be able to see on webpage anymore.
Anybody can help me with this?
Anybody can help me with this?
PHP:
<?php $reports = $SQL->query('SELECT * FROM player_reports WHERE solved = 0 ORDER BY id'); ?>
<table>
<?php foreach($reports as $report) {echo '
<tr>
<td>'.$report['id'].'</td>
<td>'.$report['date'].'</td>
<td>'.$report['name'].'</td>
<td>'.$report['report_description'].'</td>
<td><button>Solve!</button></td>
</tr>
';} ?>
</table>
Last edited: