I'm a total Ruby beginner and nearly an SQL beginner. I'm working on exercises from the book "Beginning Ruby - From Novice to Professional."
The current exercise is a simple little CRUD app, connecting to an SQLite3 db. Here's a line that's giving me trouble:
$db.execute("INSERT INTO people (job, name, gender, age) VALUES (?,?,?,?)", job, name, gender, age)
When this line executes, it always makes the first value (name, in this case) nil. I've swapped 'name' and 'job' (in both places) and then 'job' comes out nil when I display all records with "SELECT * FROM..."
Can anyone tell me what I'm doing wrong and why it's not taking the first parameter?