CHAPTER: 1 | 2 | 3 | 4 | 5 | 6 |

Chapter 1 - Answers

  1. When would you use Check boxes over Option/Radio Buttons?
    You would use Checkboxes when you want to create a logical AND between choices instead of a logical OR. i.e. This option and that option vs. This option or that option.

  2. Do you need a submit button?
    You do if you want the data entered in the form to be transmitted to the server for processing.

  3. Where does the data entered in the FORM go?
    The data entered into the FORM goes to the web server for processing, in specific the data will be delivered to the MIVA Script file specified in the ACTION attribute of the FORM tag.

 


Chapter 2 - Answers

  1. True or False. Variables in MIVA are strongly typed.

  2. True or False. You can declare a number of variables all at once.

  3. The <MVASSIGN> tag is used to declare variables.

  4. Create an if structure that will make sure the value of the p variable is greater than or equal to 99, and if so set the variable total equal to the value of p variable.
    <MVIF EXPR=”{ p GE 99 }”>
    <MVASSIGN NAME=”total” VALUE=”{ p }”>
    </MVIF>

  5. Create a function that will multiply two numbers together and return the result.
    <MVFUNCTION NAME="MultiplyTwoNumbers" PARAMETERS = " argument1, argument2">
    <MVFUNCTIONRETURN VALUE="{ argument1 * argument2 }">
    </MVFUNCTION>

 

 


Chapter 3 - Answers

  1. Why must you set the MAILHOST attribute of the <MVSMTP> tag set?
    Yes, if you want it to send the email.

  2. (True / False) You specify your client mail server for the MAILHOST value?

  3. Where does the body of your message go?
    In-between the opening and closing MVSMTP tags

  4. Can you write a MIVA application that will send two e-mails when it executes.
    Yes, just have two sets of MVSMTP tags.

 

 

 

Chapter 4 - Answers

  1. The <MVIMPORT> tag set work as loop. (true / false)

  2. The <MVIMPORTSTOP> tag will stop the writing of data to the file. (true / false)

  3. Why would you use <MVIMPORTSTOP>?
    You may only want to display 5 items from the file and then stop.

  4. What would be a good use of the FILTER attribute of the <MVIMPORT> tag set?
    To pick certain lines from the file, i.e. all the items that are red.

 


Chapter 5 - Answers

  1. The <MVCREATE> tag only creates the Xbase3 database.  It does not establish a connection to the database. (true/false)

  2. What is the advantage of using the MEMO field?
    It is good for data that may not have a specific size.

  3. MEMO field’s data is treated as other fields’ data type and is stored as part of the database. (true/false)
    MEMO fields are stored in a separate file with the extension .dbt.

  4. The <MVOPEN> tag is used to open a connection to a new database and assign it a name that can be used to refer to the connection. (true/false)

  5. The <MVFIND> tag requires an index file in order to find data in a database. (true/false)

  6. What are the two tags required to delete a record from a database?
    <MVDELETE> and <MVPACK>

  7. Does the <MVSKIP> tag require an index file?
    No MVSKIP does not require an index.

  8. The <MVINDEX> tag is used to create an index file for a database. (true/false)

 

 


Chapter 6 - Answers

  1. The <MVOPENVIEW> tag can be thought of as a table held in the memory of the web server that contains the result of your SQL command. (true/false)

  2. Does the <MVQUERY> tag return any result like <MVOPENVIEW> tag?
    No, MVQUERY does not return any results.

  3. <MVQUERY NAME=”test_db” QUERY=”{insert_str}”>. Is this is a valid Miva tag? If so, explain it.
    Yes, it will pass the command contained in the variable insert_str to the database called test_db.

  4. The <MVOPEN> tag is used to open a connection to an existing database and assign it a name that can be used to refer to this connection. (true/false)

  5. What is the functionality of the <MVCLOSEVIEW> tag?
    By closing the view you are releasing the memory back to the web server. This is very good programming practice, and every view opened should be closed.

  6. What is the difference between the QUERY attribute within the <MVOPENVIEW> tag and the <MVQUERY> tag
    The MVOPENVIEW tag issues a QUERY that will return data into the view. The MVQUERY tag is used to send a database command to the database, like an insert, update or delete but NOT a SELECT.