democrates wrote: I always echo sql statements before running them to catch these errors and avoid messing my test data by mistake. You'll see quick enough what's out of kilter. If the sql looks good try it in your mysql gui directly for a more detailed error message.
akari no ryu wrote: I'm not sure what you mean by this. I presume you mean "During test phase, I always echo sql statements" as opposed to the "I always echo sql statements and leave them there permanently". Regardless, either way is a security hazard. The first becuase you run the risk of forgetting to remove an echo statement, ending up with the second which leaves your database scheme up there making it easy to inject sql. Personally, I use the PEAR log classes. Any time an sql statement is successfully run, I log it as "info", any time it fails I log it as a criticil failure.