Marty, I went through this with a database error and the order number.
The database that Webassist makes available as an example has the wrong type in it. Change the ordernumber field in SQL from int(11) to varchar(50) The reason for the change is because the sessionID has both numbers and letters in it so it can't be stored as an int variable.
You do not need the sessionnumber field in the DB.
That should take care of the SQL error that you are getting as you are trying to put alpha characters into an int field, it doesn't work.