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

- Code is the heart of all multimedia productions. Code can animate your creative visions.
Per Thykjaer Jensen teaches multimedia programming at Aarhus Buisiness Academy. He is MA it, interaction design and multimedia, MA literature history and BA art history.