How to insert data into database using if command

Alternate INSERT discussion here:

Please continue discussion there.
This topic is now Closed to avoid cross posting confusion.