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…)

Published by

Per Thykjaer Jensen

I am a Senior Lecturer in front- and backend web programming at the Multimedia Design and Communication Programme at Business Academy Aaarhus.

I speak several languages: PHP, Python, MySQL, JavaScript, Nodejs, HTML, CSS, and … Danish.

Background: MA it, interaction and multimedia – MA Literature history – BA Art History.