CHAPTER 6 – PEAR DB – simpleQuery($query)

This method is meant for data-manipulation queries that do not return any results beyond success or failure. Its only pur- pose is that is has slightly less overhead. It returns a Boolean that indicates suc- cess or a PEAR error on failure. Here's an example: $dbh->simpleQuery("CREATE TABLE foobar (foo INT, bar INT)"); Nothing stops you from running SELECTs and other queries returning data with simpleQuery(), but the return value will be a database extension-specific resource handle. Do not use simpleQuery() for SELECTs.

Post Comment
Login to post comments