prefix . "admanager"; $id = $_GET["id"]; $title = $_POST["txt_title"]; $image = $_POST["txt_image"]; $target_url = $_POST["txt_targeturl"]; $width = $_POST["txt_adwidth"]; $height = $_POST["txt_adheight"]; //update if (isset($_POST['update'])) { $wpdb->update( $table_name, //table array('title' => $title, 'ad_image' => $image, 'target_url' => $target_url, 'div_width' => $width, 'div_height' => $height), //data array('id' => $id) //where ); } //delete else if (isset($_POST['delete'])) { $wpdb->query($wpdb->prepare("DELETE FROM $table_name WHERE id = %s", $id)); } else {//selecting value to update $ads = $wpdb->get_results($wpdb->prepare("SELECT * from $table_name where id=%s", $id)); foreach ($ads as $s) { $title = $s->title; $image = $s->ad_image; $target_url = $s->target_url; $width = $s->div_width; $height = $s->div_height; } } ?>

Ad Manager

Ad deleted

« Back to ad list

Ad updated

« Back to ad list
Title
Image
Target URL
Ad Width
Ad Height
     Back