Best is to put the reservation on hold or otherwise confirm the booking class, then call the airline and have them check if it earns mileage. It depends a lot on the airline.
It's been a few years, but back in 2000/01, my H and K class student tickets booked on USAir earned miles. STA said they didn't; I checked with USAir which confirmed that all flights booked in those classes earned miles. I even got to use my SWU's to upgrade to Envyo
.
My sister's L- and V-class fares on AA booked by STA in 2001 also earned her miles, as did my L-class fare in 2003.
My girlfriend's N-class STA fare on BA in 2003 earned her full miles on Alaska, despite Alaska's rep telling me no go (when I asked if student fares booked in any class would earn miles).
My one-way student fare on Virgin Atlantic in 2002 did not earn me miles - it was booked in a fare class (I think N) that was specifically listed by VS in its handbook as NOT earning miles.
To sum up, it's been my experience that if a student fare is booked in a class that is listed as earning miles, it does earn miles. But YMMV.
Yonatan