Due date confusion

Hi guys, so my last period was Oct. 12th and I’m very regular, 28 day cycles. So I went to the doctor yesterday at 8 weeks + 3 days and I was due July 19th. Ultrasound tech told me baby was measuring 9 weeks + 5 days and my due date would be July 12th. Which do I go by? What the baby is measuring by or my last period?