02-07-2018, 08:14 PM
Hi,
I'm new to web development, but in the last couple of days I learned a lot with the help of this forum and the documentations. Thanks!
Currently I'm encountering a problem when I try to use the $db->update() method. The table which I want to update is called u_schueler. The first column in my table is called 'id'. I want to update the column 'attestpflicht' and change the value from 0 to 1.
Here is a picture of the table u_schueler viewed with phpMyadmin:
I'm using the following code:
<pre></pre>
When I reload the .php page I don't get an error message but the database is not updated.
Do you have any suggestions?
Simon
Edit: I tried the same with the "users" datatable but nothing happened either:
<pre></pre>
I'm new to web development, but in the last couple of days I learned a lot with the help of this forum and the documentations. Thanks!
Currently I'm encountering a problem when I try to use the $db->update() method. The table which I want to update is called u_schueler. The first column in my table is called 'id'. I want to update the column 'attestpflicht' and change the value from 0 to 1.
Here is a picture of the table u_schueler viewed with phpMyadmin:
I'm using the following code:
<pre>
Code:
<?php
require_once 'users/init.php';
$i=1;
$fields = ['attestpflicht' => 1];
$db->update("u_schueler",$i,$fields);?>
When I reload the .php page I don't get an error message but the database is not updated.
Do you have any suggestions?
Simon
Edit: I tried the same with the "users" datatable but nothing happened either:
<pre>
Code:
$i=7;
$fields = [
'logins' => 4];
$update = $db->update('users',$i,$fields);