Setting up the database

For demonstration purposes, we use a Postgres database. You can use any supported database by modifying the example code (details are provided later).

For demonstration purposes, we use a database that already exists and which already contains a single record (it is possible to use Arcos to create a database, tables, columns and so on). The name of our database is "website". For simplicity, the user name and login password are also both "website". The database contains one table, named "tblfriends".

These are the fields in tblfriends:

Field nameTypeSizeComment
friendidSequencen/aEach record has a unique identifier. This is the Primary Key in SQL terms.
nameString80-
telString20We may want characters such as "ext" in the phone number, hence the field is a string.
emailString50-

The table contains a single record.

To set up your database

Note. We suggest that you follow our example above, so you can use the code that is in the examples. For details of how to perform the various steps below, refer to the documentation for your database application. Keep a record of all names and passwords.

  1. Create an empty database (called "website") using the appropriate database tools. Ensure that the user of the database (which will be Arcos) has rights to create, modify and delete tables.
  2. Create the "tblfriends" table and all of its columns.
  3. Populate the table with one or two records. For example, using command line SQL in PostgreSQL you could use:
    insert into tblfriends values ('1','mike','0114 221 1858','mike@kusala.com');