Location: PHPKode > scripts > AmpJuke > ampjuke-0.8.4/ampjuke-0.8.4/utilities/ConvertFavorite2Fav.php
// 0.5.0: Convert favorites from (old) table 'favorites' to (new) table 'fav':
// quick & dirty...no fancy output....


$qry="SELECT * FROM favorites";

while ($row=mysql_fetch_array($result)) {
		$q="INSERT INTO fav (track_id, performer_id, album_id, name, duration,";
		$q.=" last_played, times_played, year, user_id, fav_name) VALUES";
		$q.=" ('".$id."', '".$pid."', '".$aid."', ";
		$q.=", '".$r['duration']."', ";
		$q.="'".$r['last_played']."', '".$r['times_played']."', ";
		$q.="'".$r['year']."', '".$uid."', '".$row['fname']."')";

	$count++;	// Love this '++' stuff... you will NOT find that in all languages...

echo $count.' favorite entries converted from "favorites" -> "fav"';
Return current item: AmpJuke