<h1>Nutrition Database Fix</h1>

<?php

if (!$_REQUEST['confirm']) {
	?>
	<a href="?pg=<?php echo $SPADE['page']['name']; ?>&confirm=true">Click here to proceed.</a>
	<?php
} else {
	// Here we go!

	$datas = $SPADE['db']->query("SELECT id, description FROM nutrition");

	foreach ($datas as $item) {
		$SPADE['db']->query("UPDATE nutrition SET description = '".addslashes(ucwords(strtolower($item['description'])))."' WHERE id = '".$item['id']."'");
		//echo "UPDATE nutrition SET description = '".addslashes(ucwords(strtolower($item['description'])))."' WHERE id = '".$item['id']."'".BR;
	}

	//display($datas);
}

?>