Paypal standard is a completely different monster.
Paypal standard does not process transactions in real time meaning that you do not want to send receipt emails frfom the confirm page as this happens before the transaction is passed to paypal.
with paypal standard, you need to configure an IPN page to send emails on transaction success. see this page for details on IPN:
the error you are getting means that you are storing the session ID in a column that is numeric.
most likely the order id column of the order details page.