<br />$strQuery = ""; <br />$strUpdate = ""; <br />$strQuery = "SELECT U_Number, U_Picture FROM w3t_Users"; <br />$sth = $dbh -> do_query($strQuery); <br />while ( list ( $lngNumber, $strPicture ) = $dbh -> fetch_array ( $sth ) ) <br />{ <br />if ( !empty( $strPicture ) ) <br />{ <br />$strNewPicture = str_replace( "/uploads/", "/avatars/", $strPicture ); <br />$strUpdate = "UPDATE w3t_Users SET U_Picture = '$strNewPicture' WHERE U_Number = '$lngNumber'"; <br />$dbh -> do_query ( $strUpdate ); <br />} <br />} <br />$dbh -> finish_sth( $sth ); <br />