Title 0 | *Body 0 | *Footer 0 | *
Title 1 | *Body 1 | *Footer 1 | *
Title 2 | *Body 2 | *Footer 2 | *
Title 3 | *Body 3 | *Footer 3 | *
Title 4 | *Body 4 | *Footer 4 | *
* ->append('
') * ->dbInit($this->dsn) * ->queryInto('SELECT * FROM qpdb_test WHERE 1', array(), $template) * ->doneWithQuery() * ->writeHTML(); * ?> * @endcode * * The code above will take the results of a SQL query and insert them into a n * HTML table. * * If you are doing many database operations across multiple QueryPath objects, * it is better to avoid using {@link QPDB::dbInit()}. Instead, you should * call the static {@link QPDB::baseDB()} method to configure a single database * connection that can be shared by all {@link QueryPath} instances. * * Thus, we could rewrite the above to look like this: * @code *
'; * $qp = qp(QueryPath::HTML_STUB, 'body') // Open a stub HTML doc and select
* ->append('
') * ->queryInto('SELECT * FROM qpdb_test WHERE 1', array(), $template) * ->doneWithQuery() * ->writeHTML(); * ?> * @endcode * * Note that in this case, the QueryPath object doesn't need to call a method to * activate the database. There is no call to {@link dbInit()}. Instead, it checks * the base class to find the shared database. * * (Note that if you were to add a dbInit() call to the above, it would create * a new database connection.) * * The result of both of these examples will be identical. * The output looks something like this: * * @code * * *
* *
* *