I'm hacking together my first ruby script to read and write to/from mysql.
I want to know if a certain record exists. I have tried:
sql = "SELECT EXISTS(SELECT * FROM UserTrucks WHERE User = ? AND Truck = ?)"
pst = con.prepare(sql)
does_exist = pst.execute(user_id, truck_id)
but when I print the class of should_alert, it is a MySQL::STMT rather than a True or False class, or even a 0/1.
What am I missing here? Is a prepared statement even the right thing to use for this?