I figured it out. You can use UPDATE in a While loop. I was updating my $Width and $Height variables, but I was not updating my $sqlquery variable which had $Width and $Height embedded in it. Once I started updating my $sqlquery variable every time the $Width and $Height variables changed every executed as expected. Cheers! [code]$x="'21-2000SL'"; $y="'11-1000SL'"; $Width=24; $Height=12; $dsn="sandman"; $username="sa"; $password="linford"; $base_query = "UPDATE [Price Grid] SET ListPrice = (SELECT ListPrice FROM [Price Grid] WHERE (PartNo = ".$x.") AND (Width = [Width]) AND (Height = [Height])) WHERE (PartNo = ".$y.") AND (Width = [Width]) AND (Height = [Height])"; while($Width <= 72) { while($Height <= 72) { echo "$Width X $Height\n<br>"; $sqlquery = str_replace( "[Width]", $Width, $base_query ); $sqlquery = str_replace( "[Height]", $Height, $sqlquery ); $sqlconnect=odbc_connect($dsn,$username,$password); $process=odbc_exec ($sqlconnect, $sqlquery); odbc_close($sqlconnect); $Height = $Height + 6; } $Height = 17.9375; while($Height <= 72) { echo "$Width X $Height\n<br>"; $sqlquery = str_replace( "[Width]", $Width, $base_query ); $sqlquery = str_replace( "[Height]", $Height, $sqlquery ); $sqlconnect=odbc_connect($dsn,$username,$password); $process=odbc_exec ($sqlconnect, $sqlquery); odbc_close($sqlconnect); $Height = $Height + 6; } $Height = 12; $Width = $Width + 6; }[/code]