I would validate the ID prior to running the query. No point in wasting time/resources running a query when the ID is invalid.

I also tend to not bother with checking the number of rows returned. Instead I just try and fetch the result and see if I get anything. In this case it probably doesn't matter though, since you're just checking if a record exists and not actually using any result data.

That said, since you don't need any of the data from the table, don't select any so your query is quicker.

Code:

SELECT 1 FROM launch_launches WHERE id = ? AND user_id = ?

In general you should never use * in your queries, with the one allowed exception being COUNT(*). Only pull the columns you need, and list out those columns explicitly (even if it's every column in the table).

If I helped you out, show some love with some reputation, or tip with Bitcoins to 1N645HfYf63UbcvxajLKiSKpYHAq2Zxud