diff --git a/developer_manual/app/database.rst b/developer_manual/app/database.rst index 009d50980..85d16e511 100644 --- a/developer_manual/app/database.rst +++ b/developer_manual/app/database.rst @@ -52,7 +52,7 @@ Inside your database layer class you can now start running queries like: } public function find($id) { - $sql = 'SELECT * FROM `*prefix*_myapp_authors` ' . + $sql = 'SELECT * FROM `*prefix*myapp_authors` ' . 'WHERE `id` = ?'; $query = $db->prepareQuery($sql); $query->bindParam(1, $id, \PDO::PARAM_INT); @@ -101,20 +101,20 @@ To create a mapper, inherit from the mapper baseclass and call the parent constr * @throws \OCP\AppFramework\Db\MultipleObjectsReturnedException if more than one result */ public function find($id) { - $sql = 'SELECT * FROM `*prefix*_myapp_authors` ' . + $sql = 'SELECT * FROM `*prefix*myapp_authors` ' . 'WHERE `id` = ?'; return $this->findEntity($sql, array($id)); } public function findAll($limit=null, $offset=null) { - $sql = 'SELECT * FROM `*prefix*_myapp_authors`'; + $sql = 'SELECT * FROM `*prefix*myapp_authors`'; return $this->findEntities($sql, $limit, $offset); } public function authorNameCount($name) { - $sql = 'SELECT COUNT(*) AS `count` FROM `*prefix*_myapp_authors` ' . + $sql = 'SELECT COUNT(*) AS `count` FROM `*prefix*myapp_authors` ' . 'WHERE `name` = ?'; $query = $this->db->prepareQuery($sql); $query->bindParam(1, $name, \PDO::PARAM_STR); @@ -234,4 +234,4 @@ Slugs are used to identify resources in the URL by a string rather than integer $author->setName('Some*thing'); $author->slugify('name'); // Some-thing - \ No newline at end of file +