James,
Plese tell us more so we can help you. Specifically, what were you doing when the error occured. What did you expect to happen, and what happened instead. That is elaborate on what "everything worked" means and give more information on what went wrong.
Turn on VERBOSE LOGSQLERRORS in the database driver section of your aolserver config file.
Please post the actual query that caused the error. If you check the log file and have verbose and logsqlerrors set to true the entire query will show in the log. You might have to scroll back a bit to find it.
Feel free to post the relevant section from the log. Use the HTML format and place the log between <PRE></PRE> tags.