This topic is locked

How to delete an event ?

9/19/2022 10:02:27 AM
Calendar Template general questions
I
I author

I added code in the button ( server side ) to delete an event in table "calcalendar"

$IDnummer= $values['id'];
$sql = "Delete from calcalendar where id = $IDnummer";
DB::Exec( $sql );

Maar het record wordt niet verwijderd. Waarom niet ? Dank.

admin 9/19/2022

English?

I
I author 9/19/2022

I use the the French language

I
I author 9/19/2022

I added code in the button ( server side ) to delete an event in table "calcalendar"

$IDnummer= $values['id'];
$sql = "Delete from calcalendar where id = $IDnummer";
DB::Exec( $sql );

But the record is not deleted. Why not ? thanks.

admin 9/20/2022

Use Engligh, it will be easier for people to help you.

In this scenario specifically there are several possible issues.

  1. you might be adding your code to the wrong event where variable $values['id'] is not defined
  2. As a rule of thumb, instead of executing the SQL query, print it on the web page and this way you can see what exactly is wrong.