<?php

$post = $_POST['post'];
$content = $_POST['content'];
$title = $_POST['title'];
$change = $_POST['changetype'];

mysql_connect('localhost','nazwa_uzytkownika','haslo');
mysql_select_db('baza_danych');

if ($change == 'title') {
   $str = "update wp_posts set post_title = '$title' where ID = '$post'";
} else if ($change == 'content') {
   $str="update wp_posts set post_content = '$content' where ID = '$post'";
}

$result = mysql_query($str);

if ($result) {
   printf("Liczba zaktualizowanych wierszy: %d\n",mysql_affected_rows());
} else {
   echo mysql_error();
}
?> 
