Hi!
I'd like to make this mysql command into a script and run it as a cron:
DELETE FROM xx_posts WHERE post_content=''
However, I don't know how. So the question is what should the php file look like to access and delete the empty wordpress posts from the database?
Thank you!
//php file to run as cron
...db connection details...
$r = mysql_query("DELETE FROM xx_posts WHERE post_content=''");
//you could include some error or event logging too if you wanted
You should be able to set up a cronjob via cPanel or its equivalent. If you don't seem to have this facility talk to your host.
I try to create a simple OOP PHP that shows an error:
class_lib.php
<?php
class person {
var $name;
function __constructor($person_name){
echo "Initialize class";
}
function set_name($new_name){
$this->name($new_name);
} ...