get_row('SELECT SQL_CALC_FOUND_ROWS * FROM '. $scrib->harvest_table .' WHERE source_id = "tl34696000288741"'); $import = $wpdb->get_row('SELECT SQL_CALC_FOUND_ROWS * FROM '. $scrib->harvest_table .' WHERE imported = 0 LIMIT 1'); $count = $wpdb->get_var('SELECT FOUND_ROWS()'); if($count){ $post_id = $scrib_importer->insertpost(unserialize($import->content)); echo ($count - 1) .' records remain to be imported.'; if($post_id){ $wpdb->get_var('UPDATE '. $scrib->harvest_table .' SET imported = 1 WHERE source_id = "'. $import->source_id .'"'); }else{ $wpdb->get_var('UPDATE '. $scrib->harvest_table .' SET imported = -1 WHERE source_id = "'. $import->source_id .'"'); } // print_r(unserialize($import->content)); /* */ echo ' '; }else{ ?> Nothing to import.