We're actually doing this in class right now. It's a crossed aldol reaction, meaning that one strating material is enolizable (acetophenone) and the other is not.
The first step is the loss of the the proton alpha to the carbonyl on acetophenone. NaOH takes off this proton, which is the most acidic. You're left with PhCOCH2 with a minus charge. This nucleophile attacks the carbonyl carbon on p-anisaldehyde, and the double bond opens up (w/ electron density moving to the oxygen). Now you're left with Ph-CO-CH2-COH-Ph-OMe, with a formal minus charge on the oxygen that formerly belonged to the aldehyde group. I assume the NaOH was aqueous, so the O- will be protonated by water to yield the alcohol (and more base, -OH, in solution). Since NaOH is still in solution with an enolizable ketone, it will react with this product by removing the alpha-proton. This carbanion SPONTANEOUSLY forms a double bond in the alpha, beta position. This is called the E1cb mechanism (for unimolecular elimination, conjugate base). The leaving group in this case is -OH (this oxygen used to belong to the aldehyde), which is usually a terrible LG, but since the solvent you're using is NaOH, -OH is stable.
You're therefore left with PhCO-CHCH-PhOMe, or 4-methoxychalcone.
Hope this helps