<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://docs.moodle.org/38/en/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=1000camels</id>
	<title>MoodleDocs - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://docs.moodle.org/38/en/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=1000camels"/>
	<link rel="alternate" type="text/html" href="https://docs.moodle.org/38/en/Special:Contributions/1000camels"/>
	<updated>2026-05-23T03:01:09Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.5</generator>
	<entry>
		<id>https://docs.moodle.org/38/en/index.php?title=Database_activity_FAQ&amp;diff=96906</id>
		<title>Database activity FAQ</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/38/en/index.php?title=Database_activity_FAQ&amp;diff=96906"/>
		<updated>2012-04-13T04:51:24Z</updated>

		<summary type="html">&lt;p&gt;1000camels: /* Is there a Time stamp for database entries? */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Database}}&lt;br /&gt;
==Where can I download additional database presets?==&lt;br /&gt;
&lt;br /&gt;
See [[Database presets]] for discussion links with presets for download.&lt;br /&gt;
&lt;br /&gt;
==How can I add to the list of database presets available for users to choose from?==&lt;br /&gt;
&lt;br /&gt;
[[File:Database preset.png|thumb|Database presets]]&lt;br /&gt;
&lt;br /&gt;
There is one default preset, Image Gallery. It is possible to create your own presets. &lt;br /&gt;
&lt;br /&gt;
When you have created your database that you desire to set as a preset; go to the &amp;quot;Presets&amp;quot; tab of the database and choose &amp;quot;Save as preset&amp;quot;. Give the preset a name and the database fields and templates will now be available as a preset for the rest of the site. You will need site admin rights to do this.&lt;br /&gt;
&lt;br /&gt;
Please see the [[Database presets]] for other available presets you can import into your system.&lt;br /&gt;
&lt;br /&gt;
==How can I create a database in which students can only view their own entries?==&lt;br /&gt;
&lt;br /&gt;
Either:&lt;br /&gt;
*Set up the database so that entries require approval. If the entries are never approved, then only the student that added a particular entry and the teachers can view it.&lt;br /&gt;
&lt;br /&gt;
Or:&lt;br /&gt;
*Set the group mode of the database to &amp;quot;Separate groups&amp;quot; and assign each student to a separate group.&lt;br /&gt;
&lt;br /&gt;
==How can I enable a sort function by clicking on the field headings?==&lt;br /&gt;
&lt;br /&gt;
For sorting, you need to manually create the link in the template around that heading.  To find the URL you need, you can do a sort using the menus and then look in the URLs. Take out everything but the d, sort and order parameters. For example,&lt;br /&gt;
&lt;br /&gt;
http://moodle.org/mod/data/view.php?d=13&amp;amp;sort=44&amp;amp;order=ASC&lt;br /&gt;
&lt;br /&gt;
http://moodle.org/mod/data/view.php?d=13&amp;amp;sort=44&amp;amp;order=DESC&lt;br /&gt;
&lt;br /&gt;
==How can I add highlighting like on the Module and plugins page?==&lt;br /&gt;
&lt;br /&gt;
In the repeated part of the template (note onmouseover and onmouseout to change the classes):&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;tr onmouseover=&amp;quot;this.className=&#039;trhighlight&#039;&amp;quot; onmouseout=&amp;quot;this.className=&#039;trnormal&#039;&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;td class=&amp;quot;c0&amp;quot;&amp;gt;&amp;lt;b&amp;gt;&amp;lt;a href=&amp;quot;##MoreURL##&amp;quot;&amp;gt;[[Name]]&amp;lt;/a&amp;gt;&amp;lt;/b&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;td class=&amp;quot;c1&amp;quot;&amp;gt;[[Type]]&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;td class=&amp;quot;c2&amp;quot;&amp;gt;[[Requirement]]&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;td class=&amp;quot;c3&amp;quot;&amp;gt;[[Status]]&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;td class=&amp;quot;c4&amp;quot;&amp;gt;[[Summary]]&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;td align=&amp;quot;center&amp;quot; class=&amp;quot;c5&amp;quot;&amp;gt;##Edit##&amp;amp;nbsp;##Delete##&amp;amp;nbsp;##More##&amp;amp;nbsp;##Approve## &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the CSS template there are two styles:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;.trnormal td {&lt;br /&gt;
   background-color: #FFFFFF;&lt;br /&gt;
 }&lt;br /&gt;
 .trhighlight td {&lt;br /&gt;
   background-color: #EEEEEE;&lt;br /&gt;
 }&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==How can I list database information horizontally instead of vertically?==&lt;br /&gt;
*[http://moodle.org/mod/forum/discuss.php?d=74243 How can I list database information horizontally instead of vertically? Forum discussion]&lt;br /&gt;
&lt;br /&gt;
==Can&#039;t get columns to line up in list view==&lt;br /&gt;
*[http://moodle.org/mod/forum/discuss.php?d=84050 Can&#039;t get columns to line up in list view forum discussion] including moodle.org presets for download&lt;br /&gt;
&lt;br /&gt;
==How can I make an Encyclopedia database preset?==&lt;br /&gt;
*[http://moodle.org/mod/forum/discuss.php?d=87560 Encyclopedia database preset forum discussion] including encyclopedia-style preset for download&lt;br /&gt;
&lt;br /&gt;
==Is there a Time stamp for database entries?==&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;##timeadded##&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==How can I make the title of an entry into a link?==&lt;br /&gt;
&lt;br /&gt;
To make the title of an entry in list view link to the single view, add the following code to the list template:&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;a href=&amp;quot;##moreurl##&amp;quot;&amp;gt;[[Title]]&amp;lt;/a&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==How can I make email addresses clickable?==&lt;br /&gt;
&lt;br /&gt;
To make email addresses clickable, add the following code to the single template:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;a href=&amp;quot;mailto:[[Email]]&amp;quot;&amp;gt;[[Email]]&amp;lt;/a&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &#039;Email&#039; is the text field for inputting email addresses.&lt;br /&gt;
&lt;br /&gt;
==How can I delete a file attached to a database entry?==&lt;br /&gt;
&lt;br /&gt;
There is currently no user interface for deleting a file attached to a database entry, however a workaround would be to delete the entry completely and then create a new entry without the file attached.&lt;br /&gt;
&lt;br /&gt;
==How can I hide a database entry which was previously approved?==&lt;br /&gt;
&lt;br /&gt;
There is currently no user interface for hiding a database entry which was previously approved i.e. setting it to require approval again. However, an entry can be hidden using [[MySQL Admin]] by editing it in the &#039;&#039;data_records&#039;&#039; table and changing the approved value from 1 to 0.&lt;br /&gt;
&lt;br /&gt;
==How can I add a default sort order of entries?==&lt;br /&gt;
&lt;br /&gt;
In the Fields tab, select a default sort field, choose ascending or descending then click the Save button.&lt;br /&gt;
&lt;br /&gt;
==Why is my database so slow to show each page?==&lt;br /&gt;
&lt;br /&gt;
Try to go to &amp;quot;Administration &amp;gt; Miscellaneous &amp;gt; XMLDB editor&amp;quot; and choose &amp;quot;Check Indexes&amp;quot;. If you have any missing indexes found; upgrade your Moodle to the latest weekly build of your version; re-run the test; backup your site database and then run the suggested SQL from the test on your site database. This should speed up your database activity load times.&lt;br /&gt;
&lt;br /&gt;
==How can I prevent students from adding entries?==&lt;br /&gt;
&lt;br /&gt;
An override may be used to close/archive a database activity, or have a database in which only teachers can add entries, but students can view the entries.&lt;br /&gt;
&lt;br /&gt;
# Follow the Permissions link in the settings block under Database activity administration&lt;br /&gt;
# Remove Student from the capability [[Capabilities/mod/data:writeentry|mod/data:writeentry]] by clicking the &#039;X&#039; next to it.&lt;br /&gt;
# Click the continue button to confirm.&lt;br /&gt;
&lt;br /&gt;
==How can I empty a database / remove records from a database en masse?==&lt;br /&gt;
If your clearance is part of a general course clear-out e.g. at rollover time, you may be better off using Reset to clear all student activity (which Moodle calls &#039;user data&#039;) in one go.&lt;br /&gt;
&lt;br /&gt;
But if you just have one database to clear, read on.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Just one database to clear&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
# Log in, go to the Moodle area containing the database you want to clear out and Turn Editing On&lt;br /&gt;
# From the array of icons adjacent to your database to click the Duplicate icon (if in doubt, hover your mouse pointer over the icon to display a tooltip indicating what the icon does)&lt;br /&gt;
# Click through to Edit your duplicate, giving it a distinctive name to avoid confusion with the original. Then Save and return to the course area front page.&lt;br /&gt;
# You can then - assuming you have used Export to save all you need - delete the original.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Save some database records but delete others&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
# Log in, go to the area containing the database you want to clear out and Turn Editing On&lt;br /&gt;
# Click on the link to the database you want to clear&lt;br /&gt;
# From its Settings, click on Export to export all the records from your database into a CSV file; save that somewhere secure where you can find it again.&lt;br /&gt;
# Open the CSV file in e.g. a spreadsheet package, delete the records you don&#039;t want (easiest way may be to select all, unselect the ones you want to keep, then press delete) and remember to save.&lt;br /&gt;
# Then return to your Moodle area and use the Duplicate icon on the existing database to create an empty copy n.b. give it a distinctive name to avoid confusion with the original.&lt;br /&gt;
# Open up the new database, and from its Settings use Import to import the records you need into that.&lt;br /&gt;
# Test out (both viewing and adding). &lt;br /&gt;
# Once you&#039;re satisfied everything is working and you have saved all you need, you can delete the original copy.&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
Using Moodle forum discussions:&lt;br /&gt;
&lt;br /&gt;
*[http://moodle.org/mod/forum/discuss.php?d=87005 New preset, please review, and make suggestions!] including FAQ preset for download&lt;br /&gt;
*[http://moodle.org/mod/forum/discuss.php?d=88727 Design a Database Preset for Document Sharing] including preset for download&lt;br /&gt;
*[http://moodle.org/mod/forum/discuss.php?d=55338 Look of the database module]&lt;br /&gt;
*[http://moodle.org/mod/forum/discuss.php?d=61179 For those who want the display of Moodle Site&#039;s Modules and plugins]&lt;br /&gt;
*[http://moodle.org/mod/forum/discuss.php?d=94854#p457252 Looking for some stellar examples of Moodle courses] including book reviews preset for download&lt;br /&gt;
&lt;br /&gt;
[[Category:FAQ]]&lt;br /&gt;
&lt;br /&gt;
[[de:Datenbank FAQ]]&lt;/div&gt;</summary>
		<author><name>1000camels</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/38/en/index.php?title=Database_activity_FAQ&amp;diff=96905</id>
		<title>Database activity FAQ</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/38/en/index.php?title=Database_activity_FAQ&amp;diff=96905"/>
		<updated>2012-04-13T04:50:35Z</updated>

		<summary type="html">&lt;p&gt;1000camels: /* Is there a Time stamp for database entries? */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Database}}&lt;br /&gt;
==Where can I download additional database presets?==&lt;br /&gt;
&lt;br /&gt;
See [[Database presets]] for discussion links with presets for download.&lt;br /&gt;
&lt;br /&gt;
==How can I add to the list of database presets available for users to choose from?==&lt;br /&gt;
&lt;br /&gt;
[[File:Database preset.png|thumb|Database presets]]&lt;br /&gt;
&lt;br /&gt;
There is one default preset, Image Gallery. It is possible to create your own presets. &lt;br /&gt;
&lt;br /&gt;
When you have created your database that you desire to set as a preset; go to the &amp;quot;Presets&amp;quot; tab of the database and choose &amp;quot;Save as preset&amp;quot;. Give the preset a name and the database fields and templates will now be available as a preset for the rest of the site. You will need site admin rights to do this.&lt;br /&gt;
&lt;br /&gt;
Please see the [[Database presets]] for other available presets you can import into your system.&lt;br /&gt;
&lt;br /&gt;
==How can I create a database in which students can only view their own entries?==&lt;br /&gt;
&lt;br /&gt;
Either:&lt;br /&gt;
*Set up the database so that entries require approval. If the entries are never approved, then only the student that added a particular entry and the teachers can view it.&lt;br /&gt;
&lt;br /&gt;
Or:&lt;br /&gt;
*Set the group mode of the database to &amp;quot;Separate groups&amp;quot; and assign each student to a separate group.&lt;br /&gt;
&lt;br /&gt;
==How can I enable a sort function by clicking on the field headings?==&lt;br /&gt;
&lt;br /&gt;
For sorting, you need to manually create the link in the template around that heading.  To find the URL you need, you can do a sort using the menus and then look in the URLs. Take out everything but the d, sort and order parameters. For example,&lt;br /&gt;
&lt;br /&gt;
http://moodle.org/mod/data/view.php?d=13&amp;amp;sort=44&amp;amp;order=ASC&lt;br /&gt;
&lt;br /&gt;
http://moodle.org/mod/data/view.php?d=13&amp;amp;sort=44&amp;amp;order=DESC&lt;br /&gt;
&lt;br /&gt;
==How can I add highlighting like on the Module and plugins page?==&lt;br /&gt;
&lt;br /&gt;
In the repeated part of the template (note onmouseover and onmouseout to change the classes):&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;tr onmouseover=&amp;quot;this.className=&#039;trhighlight&#039;&amp;quot; onmouseout=&amp;quot;this.className=&#039;trnormal&#039;&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;td class=&amp;quot;c0&amp;quot;&amp;gt;&amp;lt;b&amp;gt;&amp;lt;a href=&amp;quot;##MoreURL##&amp;quot;&amp;gt;[[Name]]&amp;lt;/a&amp;gt;&amp;lt;/b&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;td class=&amp;quot;c1&amp;quot;&amp;gt;[[Type]]&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;td class=&amp;quot;c2&amp;quot;&amp;gt;[[Requirement]]&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;td class=&amp;quot;c3&amp;quot;&amp;gt;[[Status]]&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;td class=&amp;quot;c4&amp;quot;&amp;gt;[[Summary]]&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;td align=&amp;quot;center&amp;quot; class=&amp;quot;c5&amp;quot;&amp;gt;##Edit##&amp;amp;nbsp;##Delete##&amp;amp;nbsp;##More##&amp;amp;nbsp;##Approve## &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the CSS template there are two styles:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;.trnormal td {&lt;br /&gt;
   background-color: #FFFFFF;&lt;br /&gt;
 }&lt;br /&gt;
 .trhighlight td {&lt;br /&gt;
   background-color: #EEEEEE;&lt;br /&gt;
 }&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==How can I list database information horizontally instead of vertically?==&lt;br /&gt;
*[http://moodle.org/mod/forum/discuss.php?d=74243 How can I list database information horizontally instead of vertically? Forum discussion]&lt;br /&gt;
&lt;br /&gt;
==Can&#039;t get columns to line up in list view==&lt;br /&gt;
*[http://moodle.org/mod/forum/discuss.php?d=84050 Can&#039;t get columns to line up in list view forum discussion] including moodle.org presets for download&lt;br /&gt;
&lt;br /&gt;
==How can I make an Encyclopedia database preset?==&lt;br /&gt;
*[http://moodle.org/mod/forum/discuss.php?d=87560 Encyclopedia database preset forum discussion] including encyclopedia-style preset for download&lt;br /&gt;
&lt;br /&gt;
==Is there a Time stamp for database entries?==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;##timeadded##&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==How can I make the title of an entry into a link?==&lt;br /&gt;
&lt;br /&gt;
To make the title of an entry in list view link to the single view, add the following code to the list template:&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;a href=&amp;quot;##moreurl##&amp;quot;&amp;gt;[[Title]]&amp;lt;/a&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==How can I make email addresses clickable?==&lt;br /&gt;
&lt;br /&gt;
To make email addresses clickable, add the following code to the single template:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;a href=&amp;quot;mailto:[[Email]]&amp;quot;&amp;gt;[[Email]]&amp;lt;/a&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &#039;Email&#039; is the text field for inputting email addresses.&lt;br /&gt;
&lt;br /&gt;
==How can I delete a file attached to a database entry?==&lt;br /&gt;
&lt;br /&gt;
There is currently no user interface for deleting a file attached to a database entry, however a workaround would be to delete the entry completely and then create a new entry without the file attached.&lt;br /&gt;
&lt;br /&gt;
==How can I hide a database entry which was previously approved?==&lt;br /&gt;
&lt;br /&gt;
There is currently no user interface for hiding a database entry which was previously approved i.e. setting it to require approval again. However, an entry can be hidden using [[MySQL Admin]] by editing it in the &#039;&#039;data_records&#039;&#039; table and changing the approved value from 1 to 0.&lt;br /&gt;
&lt;br /&gt;
==How can I add a default sort order of entries?==&lt;br /&gt;
&lt;br /&gt;
In the Fields tab, select a default sort field, choose ascending or descending then click the Save button.&lt;br /&gt;
&lt;br /&gt;
==Why is my database so slow to show each page?==&lt;br /&gt;
&lt;br /&gt;
Try to go to &amp;quot;Administration &amp;gt; Miscellaneous &amp;gt; XMLDB editor&amp;quot; and choose &amp;quot;Check Indexes&amp;quot;. If you have any missing indexes found; upgrade your Moodle to the latest weekly build of your version; re-run the test; backup your site database and then run the suggested SQL from the test on your site database. This should speed up your database activity load times.&lt;br /&gt;
&lt;br /&gt;
==How can I prevent students from adding entries?==&lt;br /&gt;
&lt;br /&gt;
An override may be used to close/archive a database activity, or have a database in which only teachers can add entries, but students can view the entries.&lt;br /&gt;
&lt;br /&gt;
# Follow the Permissions link in the settings block under Database activity administration&lt;br /&gt;
# Remove Student from the capability [[Capabilities/mod/data:writeentry|mod/data:writeentry]] by clicking the &#039;X&#039; next to it.&lt;br /&gt;
# Click the continue button to confirm.&lt;br /&gt;
&lt;br /&gt;
==How can I empty a database / remove records from a database en masse?==&lt;br /&gt;
If your clearance is part of a general course clear-out e.g. at rollover time, you may be better off using Reset to clear all student activity (which Moodle calls &#039;user data&#039;) in one go.&lt;br /&gt;
&lt;br /&gt;
But if you just have one database to clear, read on.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Just one database to clear&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
# Log in, go to the Moodle area containing the database you want to clear out and Turn Editing On&lt;br /&gt;
# From the array of icons adjacent to your database to click the Duplicate icon (if in doubt, hover your mouse pointer over the icon to display a tooltip indicating what the icon does)&lt;br /&gt;
# Click through to Edit your duplicate, giving it a distinctive name to avoid confusion with the original. Then Save and return to the course area front page.&lt;br /&gt;
# You can then - assuming you have used Export to save all you need - delete the original.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Save some database records but delete others&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
# Log in, go to the area containing the database you want to clear out and Turn Editing On&lt;br /&gt;
# Click on the link to the database you want to clear&lt;br /&gt;
# From its Settings, click on Export to export all the records from your database into a CSV file; save that somewhere secure where you can find it again.&lt;br /&gt;
# Open the CSV file in e.g. a spreadsheet package, delete the records you don&#039;t want (easiest way may be to select all, unselect the ones you want to keep, then press delete) and remember to save.&lt;br /&gt;
# Then return to your Moodle area and use the Duplicate icon on the existing database to create an empty copy n.b. give it a distinctive name to avoid confusion with the original.&lt;br /&gt;
# Open up the new database, and from its Settings use Import to import the records you need into that.&lt;br /&gt;
# Test out (both viewing and adding). &lt;br /&gt;
# Once you&#039;re satisfied everything is working and you have saved all you need, you can delete the original copy.&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
Using Moodle forum discussions:&lt;br /&gt;
&lt;br /&gt;
*[http://moodle.org/mod/forum/discuss.php?d=87005 New preset, please review, and make suggestions!] including FAQ preset for download&lt;br /&gt;
*[http://moodle.org/mod/forum/discuss.php?d=88727 Design a Database Preset for Document Sharing] including preset for download&lt;br /&gt;
*[http://moodle.org/mod/forum/discuss.php?d=55338 Look of the database module]&lt;br /&gt;
*[http://moodle.org/mod/forum/discuss.php?d=61179 For those who want the display of Moodle Site&#039;s Modules and plugins]&lt;br /&gt;
*[http://moodle.org/mod/forum/discuss.php?d=94854#p457252 Looking for some stellar examples of Moodle courses] including book reviews preset for download&lt;br /&gt;
&lt;br /&gt;
[[Category:FAQ]]&lt;br /&gt;
&lt;br /&gt;
[[de:Datenbank FAQ]]&lt;/div&gt;</summary>
		<author><name>1000camels</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/38/en/index.php?title=Database_activity_FAQ&amp;diff=96904</id>
		<title>Database activity FAQ</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/38/en/index.php?title=Database_activity_FAQ&amp;diff=96904"/>
		<updated>2012-04-13T04:49:50Z</updated>

		<summary type="html">&lt;p&gt;1000camels: /* Is there a Time stamp for database entries? */  timestamp is now supported - no reason to link to old forum discussing problem&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Database}}&lt;br /&gt;
==Where can I download additional database presets?==&lt;br /&gt;
&lt;br /&gt;
See [[Database presets]] for discussion links with presets for download.&lt;br /&gt;
&lt;br /&gt;
==How can I add to the list of database presets available for users to choose from?==&lt;br /&gt;
&lt;br /&gt;
[[File:Database preset.png|thumb|Database presets]]&lt;br /&gt;
&lt;br /&gt;
There is one default preset, Image Gallery. It is possible to create your own presets. &lt;br /&gt;
&lt;br /&gt;
When you have created your database that you desire to set as a preset; go to the &amp;quot;Presets&amp;quot; tab of the database and choose &amp;quot;Save as preset&amp;quot;. Give the preset a name and the database fields and templates will now be available as a preset for the rest of the site. You will need site admin rights to do this.&lt;br /&gt;
&lt;br /&gt;
Please see the [[Database presets]] for other available presets you can import into your system.&lt;br /&gt;
&lt;br /&gt;
==How can I create a database in which students can only view their own entries?==&lt;br /&gt;
&lt;br /&gt;
Either:&lt;br /&gt;
*Set up the database so that entries require approval. If the entries are never approved, then only the student that added a particular entry and the teachers can view it.&lt;br /&gt;
&lt;br /&gt;
Or:&lt;br /&gt;
*Set the group mode of the database to &amp;quot;Separate groups&amp;quot; and assign each student to a separate group.&lt;br /&gt;
&lt;br /&gt;
==How can I enable a sort function by clicking on the field headings?==&lt;br /&gt;
&lt;br /&gt;
For sorting, you need to manually create the link in the template around that heading.  To find the URL you need, you can do a sort using the menus and then look in the URLs. Take out everything but the d, sort and order parameters. For example,&lt;br /&gt;
&lt;br /&gt;
http://moodle.org/mod/data/view.php?d=13&amp;amp;sort=44&amp;amp;order=ASC&lt;br /&gt;
&lt;br /&gt;
http://moodle.org/mod/data/view.php?d=13&amp;amp;sort=44&amp;amp;order=DESC&lt;br /&gt;
&lt;br /&gt;
==How can I add highlighting like on the Module and plugins page?==&lt;br /&gt;
&lt;br /&gt;
In the repeated part of the template (note onmouseover and onmouseout to change the classes):&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;tr onmouseover=&amp;quot;this.className=&#039;trhighlight&#039;&amp;quot; onmouseout=&amp;quot;this.className=&#039;trnormal&#039;&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;td class=&amp;quot;c0&amp;quot;&amp;gt;&amp;lt;b&amp;gt;&amp;lt;a href=&amp;quot;##MoreURL##&amp;quot;&amp;gt;[[Name]]&amp;lt;/a&amp;gt;&amp;lt;/b&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;td class=&amp;quot;c1&amp;quot;&amp;gt;[[Type]]&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;td class=&amp;quot;c2&amp;quot;&amp;gt;[[Requirement]]&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;td class=&amp;quot;c3&amp;quot;&amp;gt;[[Status]]&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;td class=&amp;quot;c4&amp;quot;&amp;gt;[[Summary]]&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;td align=&amp;quot;center&amp;quot; class=&amp;quot;c5&amp;quot;&amp;gt;##Edit##&amp;amp;nbsp;##Delete##&amp;amp;nbsp;##More##&amp;amp;nbsp;##Approve## &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the CSS template there are two styles:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;.trnormal td {&lt;br /&gt;
   background-color: #FFFFFF;&lt;br /&gt;
 }&lt;br /&gt;
 .trhighlight td {&lt;br /&gt;
   background-color: #EEEEEE;&lt;br /&gt;
 }&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==How can I list database information horizontally instead of vertically?==&lt;br /&gt;
*[http://moodle.org/mod/forum/discuss.php?d=74243 How can I list database information horizontally instead of vertically? Forum discussion]&lt;br /&gt;
&lt;br /&gt;
==Can&#039;t get columns to line up in list view==&lt;br /&gt;
*[http://moodle.org/mod/forum/discuss.php?d=84050 Can&#039;t get columns to line up in list view forum discussion] including moodle.org presets for download&lt;br /&gt;
&lt;br /&gt;
==How can I make an Encyclopedia database preset?==&lt;br /&gt;
*[http://moodle.org/mod/forum/discuss.php?d=87560 Encyclopedia database preset forum discussion] including encyclopedia-style preset for download&lt;br /&gt;
&lt;br /&gt;
==Is there a Time stamp for database entries?==&lt;br /&gt;
##timeadded##&lt;br /&gt;
&lt;br /&gt;
==How can I make the title of an entry into a link?==&lt;br /&gt;
&lt;br /&gt;
To make the title of an entry in list view link to the single view, add the following code to the list template:&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;a href=&amp;quot;##moreurl##&amp;quot;&amp;gt;[[Title]]&amp;lt;/a&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==How can I make email addresses clickable?==&lt;br /&gt;
&lt;br /&gt;
To make email addresses clickable, add the following code to the single template:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;a href=&amp;quot;mailto:[[Email]]&amp;quot;&amp;gt;[[Email]]&amp;lt;/a&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &#039;Email&#039; is the text field for inputting email addresses.&lt;br /&gt;
&lt;br /&gt;
==How can I delete a file attached to a database entry?==&lt;br /&gt;
&lt;br /&gt;
There is currently no user interface for deleting a file attached to a database entry, however a workaround would be to delete the entry completely and then create a new entry without the file attached.&lt;br /&gt;
&lt;br /&gt;
==How can I hide a database entry which was previously approved?==&lt;br /&gt;
&lt;br /&gt;
There is currently no user interface for hiding a database entry which was previously approved i.e. setting it to require approval again. However, an entry can be hidden using [[MySQL Admin]] by editing it in the &#039;&#039;data_records&#039;&#039; table and changing the approved value from 1 to 0.&lt;br /&gt;
&lt;br /&gt;
==How can I add a default sort order of entries?==&lt;br /&gt;
&lt;br /&gt;
In the Fields tab, select a default sort field, choose ascending or descending then click the Save button.&lt;br /&gt;
&lt;br /&gt;
==Why is my database so slow to show each page?==&lt;br /&gt;
&lt;br /&gt;
Try to go to &amp;quot;Administration &amp;gt; Miscellaneous &amp;gt; XMLDB editor&amp;quot; and choose &amp;quot;Check Indexes&amp;quot;. If you have any missing indexes found; upgrade your Moodle to the latest weekly build of your version; re-run the test; backup your site database and then run the suggested SQL from the test on your site database. This should speed up your database activity load times.&lt;br /&gt;
&lt;br /&gt;
==How can I prevent students from adding entries?==&lt;br /&gt;
&lt;br /&gt;
An override may be used to close/archive a database activity, or have a database in which only teachers can add entries, but students can view the entries.&lt;br /&gt;
&lt;br /&gt;
# Follow the Permissions link in the settings block under Database activity administration&lt;br /&gt;
# Remove Student from the capability [[Capabilities/mod/data:writeentry|mod/data:writeentry]] by clicking the &#039;X&#039; next to it.&lt;br /&gt;
# Click the continue button to confirm.&lt;br /&gt;
&lt;br /&gt;
==How can I empty a database / remove records from a database en masse?==&lt;br /&gt;
If your clearance is part of a general course clear-out e.g. at rollover time, you may be better off using Reset to clear all student activity (which Moodle calls &#039;user data&#039;) in one go.&lt;br /&gt;
&lt;br /&gt;
But if you just have one database to clear, read on.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Just one database to clear&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
# Log in, go to the Moodle area containing the database you want to clear out and Turn Editing On&lt;br /&gt;
# From the array of icons adjacent to your database to click the Duplicate icon (if in doubt, hover your mouse pointer over the icon to display a tooltip indicating what the icon does)&lt;br /&gt;
# Click through to Edit your duplicate, giving it a distinctive name to avoid confusion with the original. Then Save and return to the course area front page.&lt;br /&gt;
# You can then - assuming you have used Export to save all you need - delete the original.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Save some database records but delete others&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
# Log in, go to the area containing the database you want to clear out and Turn Editing On&lt;br /&gt;
# Click on the link to the database you want to clear&lt;br /&gt;
# From its Settings, click on Export to export all the records from your database into a CSV file; save that somewhere secure where you can find it again.&lt;br /&gt;
# Open the CSV file in e.g. a spreadsheet package, delete the records you don&#039;t want (easiest way may be to select all, unselect the ones you want to keep, then press delete) and remember to save.&lt;br /&gt;
# Then return to your Moodle area and use the Duplicate icon on the existing database to create an empty copy n.b. give it a distinctive name to avoid confusion with the original.&lt;br /&gt;
# Open up the new database, and from its Settings use Import to import the records you need into that.&lt;br /&gt;
# Test out (both viewing and adding). &lt;br /&gt;
# Once you&#039;re satisfied everything is working and you have saved all you need, you can delete the original copy.&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
Using Moodle forum discussions:&lt;br /&gt;
&lt;br /&gt;
*[http://moodle.org/mod/forum/discuss.php?d=87005 New preset, please review, and make suggestions!] including FAQ preset for download&lt;br /&gt;
*[http://moodle.org/mod/forum/discuss.php?d=88727 Design a Database Preset for Document Sharing] including preset for download&lt;br /&gt;
*[http://moodle.org/mod/forum/discuss.php?d=55338 Look of the database module]&lt;br /&gt;
*[http://moodle.org/mod/forum/discuss.php?d=61179 For those who want the display of Moodle Site&#039;s Modules and plugins]&lt;br /&gt;
*[http://moodle.org/mod/forum/discuss.php?d=94854#p457252 Looking for some stellar examples of Moodle courses] including book reviews preset for download&lt;br /&gt;
&lt;br /&gt;
[[Category:FAQ]]&lt;br /&gt;
&lt;br /&gt;
[[de:Datenbank FAQ]]&lt;/div&gt;</summary>
		<author><name>1000camels</name></author>
	</entry>
</feed>