help with - 2 digit 7 segment display and 2 74hc595

Your LED display has the segments connected together, yet your code expected the segments to be different.

For your code to work for your display, you will have to remember which digit it is displaying.