a simple example (assuming mySQL):
<?php
// connect to db
$result = mysql_query("SELECT id, rootfolder FROM tablepath WHERE rootfolder LIKE '%Agriculture%'") or exit(mysql_error());
while ($row = mysql_fetch_assoc($result))
{
$rootfolder = str_replace('Agriculture', 'New_Agriculture', $row['rootfolder']);
$result_update = mysql_query("UPDATE tablepath SET rootfolder = '$rootfolder' WHERE id = " . $row['id']) or exit(mysql_error());
echo 'row ' .$row['id'] . ' updated<br>';
}
?>