Update not working

Please i am trying to update a db, and its not working, the code is below, any clue will be appreciated

    $pplresult = mysql_query("SELECT * FROM outstanding WHERE Uname = '{$_SESSION['username']}'") or die(mysql_error());
  $row = mysql_fetch_assoc($pplresult);
    //echo $obal;
   // echo $row['obal'];
 $queryreg = mysql_query("
UPDATE outstanding
	SET obal = '{$row['outstandingbal']}'
			WHERE obal='{$row['obal']}'
			Uname = '{$_SESSION['username']}'
 ") or die(mysql_error());
      $queryreg2 = mysql_query("
		UPDATE outstanding
				SET outstandingbal='0'
					WHERE outstandingbal='{$row['$outstandingbal']}'
							AND Uname = '{$_SESSION['username']}'
   ") or die(mysql_error());
  echo $row['obal'];

What does “is not working” mean? Do you get an error?

@lostty84; Please be aware that the mysql_* extension is now deprecated as of the current version of PHP and will very likely be removed from the next 5.x version and will likely not be in PHP 6.x (when it eventually is released). You should migrate over to either the mysqli_* extension or to PDO. PDO is a better choice as it doesn’t tie you down so much to a particular database server software.

Also your 2nd and 3rd queries ony make use of the obal field, so in the first you should just list that field only as the SELECT * returns every field irrespective of which ones are actually needed.

@spacephoenix, please can you direct me to an article on how to migrate over as i have warned severally on this forum to move, and i have not been able to do that(sorry if i sound like a weak programmer)

in the code above i found that ‘if($totalprice=0)’ was supposed to be if($totalprice==0) whereby it equals not assigned to as i was doing

That should explain it all, if you have any problems with the migration that start a fresh thread in the PHP forum