Categories
Kanban

Phpscaffold og WordPress

Phpscaffold skaber en række filer, der kan inkluderes i et plugin. Men filerne skal editeres en anelse. Linjen include(‘config.php’);  skal fjernes, og resten burde teoretisk set fungere a la det her:

$Id = (int) $_GET['Id']; 
// mysql_query("DELETE FROM `kbnNotes` WHERE `Id` = '$Id' ") ; 
$wpdb->query("DELETE FROM `kbnNotes` WHERE `Id` = '$Id' ");
echo (mysql_affected_rows()) ? "Row deleted.<br /> " : "Nothing deleted.<br /> ";

(NB: jeg har ikke afprøvet koden endnu, så det her er kun noter…)

By Per Thykjaer Jensen

Per is the WordPress expert at Business Academy Aarhus. Senior Lecturer at the Multimedia Design Programme. His background is in the Arts: MA Literature History and BA Art History. Later he added a MA in IT, interaction and Multimedia. And he is a wicked Linux user.