Friday, May 29, 2009

Exercise 8: Answer

1. Start with a simple table in the database: In order to get this to happen I needed to create a database and then create a table 'employees'
DROP TABLE IF EXISTS `exercise8`.`employees`; CREATE TABLE `exercise8`.`employees` ( `first` varchar(45) NOT NULL, `last` varchar(45) NOT NULL, `address` varchar(45) NOT NULL, `position` varchar(45) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
insert a record
insert into exercise8.employees(first,last,address,position) values('First','Last','Address','Position');
run the query
SELECT * FROM exercise8.employees e;
and the result surprise, surprise is the first record from the employees table. 2. Create a Webpage
Here is a screenshot of the code and the webpage output

3. and 4. Add a record
Here is a screenshot of the webpage output and the code
5. Retrieve multiple records
Here is a screenshot of the webpage output and the code

Exercise 7: Answer

1. Short but simple. They say a picture is worth a thousand words, so here is 2000.

2.

Exercise 6: Answer

1 and 2 combined An image of the webpage output and the code that produced it:

Thursday, May 28, 2009

Exercise 2: Answer

Web Quest to find 5 sites offering different business options:

1. Online shopping

2. Electronic payments

3. Database access

4. WAP sites for mobile phones
I have a mobile phone that is used for only one thing, making phone calls. And I might make about 1 or 2 of those a month. So I am not what you would really call mobile phone savvy. Having said that, my plan will be up for renewal soon and I am thinking about application development in the work environment. So this may become much more relevant to me in the future.

Exercise 1: Answer

1. Visit http://yahoo.com and http://zope.org as examples of online communities.
    a. What is meant by an online community and how is it important for e-commerce?

"An online community is: Where a group of people with similar goals or interests connect and exchange information using web tools." (Owyang)

This brings a community of like-minded people together. So an on-line community is good in enabling communication. From a commerce perspective it opens up the avenues available to the consumer, providing much greater choice and options. It also provides greater scope to the retailer by reducing the physical presence requirements that a traditional shop-front store entails.
However with the good comes the bad as expressed by (Malik)

References
Owyang, J. (December 28th, 2007). Retrieved 21 May 2009, from http://www.web-strategist.com/blog/2007/12/28/defining-the-term-community/ Malik, O. ( Tuesday, October 18, 2005 ). Web 2.0, Community & the Commerce Conundrum. Retrieved 21 May 2009, from http://gigaom.com/2005/10/18/web-20-the-community-the-commerce-conundrum/ b. Visit the three auctions sites at http://ebay.com, http://ebay.co.uk and http://ebay.com.au:
         i.   Is there a common thread and a local community sense in action?

The 3 sites http://ebay.com/, http://ebay.co.uk/ and http://ebay.com.au/ are very similar.

They are localized and user aware. I was asked by both the US and the UK site if I would rather visit the Australia site. From a personal view that is very good as it starts you feeling welcome straight away.

The home page for eBay Australia(Tuesday 19 May 9:30pm) has the following:


        ii.  What electronic payment systems are used? Are they globally acceptable?

AU UK US
PayPal PayPal PayPal
Credit Card Credit or Debit Cards Credit or Debit Cards
Personal or Bank Cheques Pay on collection Moneybookers
Money Orders Escrow Paymate
Bank Deposits or Bank Deposit Express Other payment methods ProPay
COD   Pay on collection
    Escrow
    Other Payment methods

Some of these payment methods are globally acceptable, but not all.


         iii. What are the benefits to of an online auction sale to a buyer, a seller and E-bay owners?

(Wright) sums up the answer to this question perfectly:

eBay provides the legal framework, contractual templates and basis of commercial trading for C2C, B2C and B2B clients.

References
Wright, C. (26 April 2009). Visiting EBay. Retrieved 21 May 2009, from http://itc565developersblog.blogspot.com/2009/04/visiting-ebay.htm

     c. Find three others examples of an online business using an online community approach.

2. Visit the famous online store front at http://www.amazon.com
    a. Why has it been a successful site? How does the purchase of a book work?

Amazon allows a consumer to browse for items of interest. If an item piques the interest of the consumer, Amazon will suggest alternatives and additional items that relate to the consumers choice. This suggesting is based upon previous choices by the consumer and others who have made similar choices.

The steps to purchase a book are as follows:

  • Search for book/item
  • Select book/item
  • Choose other books/items
  • Proceed to checkout
  • Enter payment and shipping options
  • Discount coupons can be entered at this stage
  • Payment is validated and books/items are dispatched
  • Await delivery of goods


    b. Is there any secure transactions not involving money?

Amozon allows multiple methods of paying for items as discussed above. It also allows for payment in the form of gift certificates, reward certificates, free offers if you purchase certain quantities and rebates on goods. It could be argued that these are all a form of monetary transaction, but to the consumer who is making the sale these can be seen as extra incentive. Maybe they are the straw that causes the consumer to make the purchase.


   c. What is the range of items that you can buy?
        i. List the steps involved and comment.

I think a better question could well be "What can't you buy?".

The list of purchasable items at Amazon seems to be growing every day.

This image is just the top level menu showing the departments within which a purchase can be made.

Here are the steps you need to follow to place an order.(Amazon.com)



I have purchased many books on Amazon, all of them computer related, predominantly with a Microsoft development mentality bias. I have found the process to be painless, cheaper than buying locally and worry free.
References
Amazon.com. Placing Your First Order. 21 May 2009, from http://www.amazon.com/gp/help/customer/display.html/ref=hp_navbox_lnor_new?nodeId=524700

Wednesday, May 27, 2009

Exercise 6: First attempt

Well found it: " ?> It definitely helps when you get the syntax correct. The answer to my question was sourced from http://au2.php.net/manual/en/reserved.variables.server.php In my mission to find out how to use php, I created the hello_world application. It didnt provide any surprises at all. And no problems either.

Exercise 6: First attempt

Well just going from the notes I thought I would just create a html file and open it in a browser. (did I tell you that what I know about php was what was written in the exercise?) So I dutifully copied the exercise code into notepad, saved it as exercise6.html, and opened it in IE8. I am sure that you will all be as surprised as I was to see that the screen was blank. Well so much for the short cut. Ok off to the web site http://php.net. I have now downloaded and installed WampServer 2.0h available from http://www.wampserver.com/en/download.php This has loaded Apache 2.2.11,PHP 5.2.9, SQLitemanager,MySQL 5.1.33 Phpmyadmin As to what I do with any of this. I am sitting here scratching my head with not the first clue as to what needs to happen now. I have WAMP started and online. Well finally I have gotten the page to display. It doesnt work but thats another issue. I am surprised that I have any hair left. None of that was obvious. (Although in hindsite it should have been). My MySQL issues are continuing however. I get the following message Access denied for user 'root'@'localhost' (using password:NO) trying to find the connection string settings in the php.ini file is like looking for a needle in a haystack. I think i would rather find the needle. When trying to display the file for exercise 6 I was getting the Undefined variable REMOTE_ADDR which makes sense as Ken said in the notes that this is the UNIX environment variable. So I should be able to change it with the php equivalent of _SERVER["REMOTE_ADDR"] WRONG! Maybe it is a good time to ask for help. What is wrong with this code ?????: "; ?> What should this look like?

Workshop 1: Setting up Ruby on Rails

Well I decided that the Win7 environment was a little bit too progressive to try and get the Ruby environment operational. I was getting security issues with the Aptana IDE not recognising the MySQL installation. I downloaded MySQL v5.1 and tried to install that. The installation stalled when it was trying to create the initialisation file, so I was unable to set the root password or create the admin user. So I decided to start again. Last night I created a new VM and loaded XP SP3. I then loaded MySQL v5.1 and the MySQL v5 GUI tools. This time the installation went off without a hitch and I was able to create the initialization file. I installed Aptana, then installed the RADRails perspective, which loaded all the relevant gems. I created a default/ test project using SQLlite3 and this worked fine, first go. That working I attempted to create a project using MySQL as the database. Unfortunately there are still errors being thrown and it is indicating that their are missing files relating to the MySQL gem. This fails midstep. So I have decided that their is little prospect for me to be able to learn anything if I continue trying to get MySQL to work. Consequently all further work will involve me using SQLlite3 as the database backend. And thanks to Ken for giving that the ok today.

Monday, May 25, 2009

Workshop 1: Loading MySQL

I have been attempting to get MySQL installed on my VM for the past few days, have had no luck and am not going to devote anymore time to it.

I goy the Aptana IDE installed, and it seems nice enough, and relatively easy to use. I followed the demo video on Saturday and had to replay the steps a few times to see what options they selected. I got the example to work. Was unable to get anything working if I chose MySQL as the default database. I get errors stating that the machine is denying the request. I don't have a screenshot of the error message unfortunately.

Having had no luck I decided that I would attempt to install MySQL on the VM. As I said above, this has proven to be unsuccessful. As this course is not about Installing and configuring MySQL I don't believe it is worth the time to track down the cause of the issue.

This is a screenshot of the Aptana IDE showing the working test project. It may be that I am impatient, or far to used to a Windows wizard as far as installations go. I say that because the InstantRails install that I did left a lot to be desired. If you install something why do you then have to actually find the documentation that tells you how to configure it. Why wasnt that part of the installation process. I experienced this with the MySQL install as well. I only found the InstantRails config documentation tonight when I was trying to fix up the MySQL install. Well thats enough for now, back to the exercises. Until next time ...