The following warnings occurred:
Warning [2] Undefined variable $unreadreports - Line: 26 - File: global.php(961) : eval()'d code PHP 8.2.25 (Linux)
File Line Function
/global.php(961) : eval()'d code 26 errorHandler->error
/global.php 961 eval
/showthread.php 28 require_once





× This forum is read only. As of July 23, 2019, the UserSpice forums have been closed. To receive support, please join our Discord by clicking here. Thank you!

  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
problems using db->update
#1
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: [Image: unbenanntavknv.jpg]

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);?>
</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 Smile

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);
</pre>
  Reply


Messages In This Thread
problems using db->update - by s.farg - 02-07-2018, 08:14 PM
problems using db->update - by mudmin - 02-07-2018, 09:27 PM
problems using db->update - by s.farg - 02-07-2018, 09:50 PM
problems using db->update - by mudmin - 02-07-2018, 10:15 PM
problems using db->update - by s.farg - 02-07-2018, 11:10 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)