The following warnings occurred:
Warning [2] Undefined variable $unreadreports - Line: 26 - File: global.php(961) : eval()'d code PHP 8.1.2-1ubuntu2.14 (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
UPDATE DB
#1
Okay first of all thank you guys for this project. It's easy to use and very exandable! Smile

I use it for my own CMS and event website etc. But I'm very stuck on the latter with updating agenda items.... I use the insert function to make events. U use a db->query(DELETE FROM) to remove it. But updating just doesn't seem to work. I tried the update function provided by userspice and typing out a db->query(UPDATE agenda SET desc = ? WHERE id = $id) But nothing seems to work. Which is weird since it does give the succes message.

I really don't know what to do and am a beginner in PHP and sql. Can someone please be so kind to point me in the right direction?

Here is the PHP file:

<?php

require_once 'users/init.php';
require_once $abs_us_root . $us_url_root . 'users/includes/header.php';
require_once $abs_us_root . $us_url_root . 'users/includes/navigation.php';
if (!securePage($_SERVER['PHP_SELF'])) {
die();
}
$id = $_POST['agendaid'];
$title = $_POST['title'];
$day = $_POST['day'];
$month = $_POST['month'];
$year = $_POST['year'];
$time = $_POST['time'];
$desc = $_POST['desc'];
$fblink = $_POST['fblink'];

$content1 = $db->query("SELECT * FROM agenda WHERE id = ?", [$id]);
$results = $content1->results();
$z1 = $query->results(true); //dump($z[0]);



$x = $z1[$eventid]["eventid"];



error_reporting(E_ERROR | E_PARSE | E_CORE_ERROR);

if ($z1[0]) {

$field = array('desc' => $desc); //column_name=>entry
$db->update('agenda', $id, $fields);

$db->query("UPDATE agenda SET desc = ? WHERE id = ?", [$desc, $id]);

echo '<div style="text-align:center;">Evenement is succesvol gewijzigd.<br /><br />Je wordt automatisch binnen 5 seconden teruggestuurd naar de vorige pagina.</div>';
header("refresh:5;url=testpermissions.php");
error_reporting(E_ERROR | E_PARSE | E_CORE_ERROR);
} else {

echo '<div style="text-align:center;">Er is iets fout gegaan...</div';
header("refresh:5;url=testpermissions.php");
}

if ($db->query()) {

}// End of if profile is ok
else {
echo 'Something went wrong... Contact the website administrator for help';
}



require_once $abs_us_root . $us_url_root . 'users/includes/page_footer.php'; // the final html footer copyright row + the external js calls
  Reply


Messages In This Thread
UPDATE DB - by Jamezs - 01-04-2018, 02:09 AM
UPDATE DB - by Brandin - 01-04-2018, 02:24 PM
UPDATE DB - by Jamezs - 01-05-2018, 12:48 PM
UPDATE DB - by Brandin - 01-05-2018, 01:08 PM
UPDATE DB - by Jamezs - 01-05-2018, 01:32 PM
UPDATE DB - by Jamezs - 01-05-2018, 01:43 PM
UPDATE DB - by Brandin - 01-05-2018, 05:54 PM
UPDATE DB - by Jamezs - 01-05-2018, 09:32 PM
UPDATE DB - by Brandin - 01-05-2018, 10:18 PM
UPDATE DB - by Jamezs - 01-05-2018, 11:28 PM
UPDATE DB - by Jamezs - 01-21-2018, 01:48 AM

Forum Jump:


Users browsing this thread: 2 Guest(s)