For some reason the following script isn't working, it keeps on telling me "Failed to update!"
<?php
mysql_connect("localhost","root","");
mysql_select_db("tcw");
$values = mysql_query("SELECT * FROM trade WHERE id>0");
while($row = mysql_fetch_array($values))
{
$id = $row[id];
$min = $row[min];
$max = $row[max];
$inner = mt_rand($min,$max);
$mid = mt_rand($min,$max);
$outer = mt_rand($min,$max);
$sql = "UPDATE trade SET inner = '$inner' AND mid = '$mid' AND outer = '$outer' WHERE id = '$id'";
$result = mysql_query($sql) or die("Failed to update!");
}
?>