Waraku Education

Ideas, experiments and observations as they occur [and I have time] relating to teaching and learning in a secondary school - special focus on ICT.

Saturday, December 31, 2005

PHP MySQL Learning program plan

I think I will use the approach that the following tutorial takes for students to learn PHP and MySQL. The tutorial is in 8 parts and integrates the learning of both PHP and MySQL using a project to create an online contacts system. The example is rather droll but I would be encouraging students to read the tutorial and actually create a slightly different system as they worked their way through it. I like this because it immediately puts the students into a higher order thinking mode where they are interpreting the information from the tutorial and applying it to their scenario. For less able students working precisely through the tutorial would be the preferred option.
http://www.freewebmasterhelp.com/tutorials/phpmysql/1

I think that it will need some adapting as I would prefer each of the 8 units to more clearly produce a little PHP script in its own right. There are a set of completed scripts for the example that can be downloaded from the site.

The creating of the tables will also need to be worded differently so that each student creates their own table OR a separate database will need to be created for each student. I think I will use the approach – create a table called ‘[username]contacts’ in the database called ‘xyz’.


http://www.tizag.com/
Very good MySQL and PHP tutorials. The MySQL tutorial “focuses heavily on using MySQL in a PHP environment and is aimed at persons who have a web host with PHP and MySQL already installed”. It creates and uses a little contacts table, much simpler than http://www.freewebmasterhelp.com/tutorials/phpmysql/1 but the explanations are much clearer.

So perhaps a contacts database using these sorts of explanations.


http://dev.mysql.com/tech-resources/articles/ddws/
The approach used in this book is more appealing, using a jokes database as the scenario but has students working directly with the MySQL interface initially. The advantage of using PHP scripts to set up the database is that the student can take their scripts to another server and use the scripts to recreate their system. They have something that they can take with them and use else where. Just tweak the setup scripts and execute them for the new server.


It seems that I will need to use these tutorials to create my own. Two blokes from Victoria, Graham and John, have produced tutorials. Both of them have given permission to use and adapt. Neither of theirs will perfectly work either. John’s is a very heavy programming theme with databases coming in near the end. Grahams takes on similar flavour to
http://dev.mysql.com/tech-resources/articles/ddws/ but uses a tool like phpmyadmin to set up the tables. Maybe I will adapt Graham’s so that the table is setup using PHP? I would prefer having the tutorial around a contacts database and the challenge is for students to use this to create a jokes database as they read the tutorial. That way the creative part is more fun.

What to do?

Tuesday, December 20, 2005

Planning the php/mysql learning environment

What an intense day. Very little php learning and programming today but very successful in terms of establishing what I think the development environment will look like at school.

PHP editors
I have downloaded and had a look at

This is an open source product but it seems to be designed to be the one stop shop for program editing. To give it the PHP capability it required the PHPeclipse addon. I liked the integration with xampp in that it had buttons for the control of the xampp tools. It was not exactly easy to set up and I could not find the bits that did syntax checking and provided help with the program action words

  • phpCodeGenie – “phpCodeGenie (PCG) is a code generator for database driven applications.”

This idea had immense appeal but I could not get it to work. Maybe I will come back to this one day.

I have also downloaded the latest beta release of PHP Designer (now 2006). I think that I will stay with this program. While it is not Open Source it is free. It can be installed at school on all student computers and does not need the xampp bits to write code with. If the debugging is done with PHP Designer then xampp would also need to be installed and that’s where issues start because I do not want students storing their work locally on machines. So for debugging I think we will use a LiveLamp server.

At home I will use a combination of PHP Designer and xampp. This will create some issues working between school and home. The versions of mysql differ between LiveLamp and xampp. This has meant that a database made in the xampp environment could not be backed up and restored to the LiveLamp environment. There are probably other differences. A way that I could get around this is to have another old clunker puta here at home as a LiveLamp server so that home looked like school.

Maybe this is more expedient for now although I reckon LiveLamp would be more useful if it was in step with xampp software versions. The reason for this is that currently there are lots of windows machines in schools at home. Students and teachers could install xampp at home to continue their learning with greater transparency.

LiveLamp
The Victorian IT teachers forums and the developers of LiveLamp have been fantastic. Con Zymaris of Open Source Victoria made the suggestion of looking at LiveLamp. I downloaded and installed this last night. The installation really was a no brainer but I had a few issues that were quickly resolved via the LiveLamp talklist. Trent Buck, Con and Peter Lieverdink have been very quick to respond. The issues were
  • I could not connect to the LiveLamp server using ftp – the server uses sftp. Installing and using Filezilla, which I should have done more than twelve months ago, fixed this. Filezilla has a nice export settings feature that I could use to manage my environment at school and home better as I am able to do with Firefox and Thunderbird.
  • I could not access files I had uploaded to LiveLamp via sftp – I was missing a ~ in the url. To access a file for student 1 (s001) I needed to use the urlhttp://[LiveLampServerIP]/~s001/filename
    There was a great suggestion that possibly using Windows Explorer as per this link would work. That would have been brilliant except that Windows Explorer doesn’t like sftp either.
When it comes to mysql use I think the following will be the strategy. I am working toward using PHP and MySQL with my classes. My vision is that students set up their databases using phpmyadmin and we write some php to interact with it.

My limited experience with LiveLamp indicates that it has an installation of mysql that is managed at http://[LiveLampIP]/phpmyadmin/main.php

This would mean that a class of students would all need to access this interface to set up their databases and they would see each others work. I could initially make blank databases called s001, s002, s003,.............and leave it to the students to make the tables in their respective databases using phpmyadmin. This could mean that one student can damage another students work but this sort of behaviour is not common so I am not too worried about that.

Current Solution
So this is the way it looks right now. Students have four windows open on their desktops.
  1. Students use PHP Designer 2006 to create php files that they save in their network home folders.
  2. They use Filezilla to transfer files to their LiveLamp folders so that they can be tested - NOTE remind students frequently not to save passwords.
  3. They use a browser to test the file
  4. They have another browser window open to the Moodle site that the course will be hosted on.
And as I am writing this I am downloading the LiveLamp 0.3.1 iso. Cool, a new version was released between yesterday and today. Well that could be bugger as well I suppose.

Monday, December 19, 2005

Form to update MySQL table

That tutorial at http://www.tizag.com/mysqlTutorial/mysqlinsert.php has been great. I have successfully created a html form and used the data input into this form to update a MySQL table. Fantastic.

Now I have enough to continue building my knowledge and feel comfortable with this development environment. I am not sure that it is the best environment for school and this relates to my next question. Before I go too much further I need to work out how do I implement this learning in a school.

Issues

  • Students should not store there work on a PC. PC’s can be re-imaged without notice. We can not assume that students will work on the same PC each time either. They will need to be able to continue with their work at other locations in the school and hopefully at home.
  • I would be happy with students doing their development on an external server so that it can be accessed from school and home. However, working on a server adds complexity as code has to be written, uploaded to the server and then executed by checking with a browser. They do not get the benefit of using tools like PHP Designer 2005.
  • How do you easily have a server set up so that 20 students can each have their space for testing?
  • It is easy to backup a database, destroy it and then restore it using PHPmyadmin. PHP files can be copied to another location

Sunday, December 18, 2005

PHP/MySQL - early success

In 12 months time the SA SACE IT curriculum will change to include a greater emphasis on programming. One of the options is web site server side programming. These holidays will be the time for me to make a start on learning about this.

I have downloaded and installed xampp with the Python and Perl add-ons. Setup and configuration was a snap except that the Apache server would not start until I changed the port that Skype was using from port 80. Since I modified the MySQL login credentials the samples (eg CD’s) did not work until I modified the relevant PHP files using a text editor.

Next was to download and install the freeware tool PHP Designer 2005 . A couple of configuration settings were needed to let PHP Designer know where the PHP interpreter was located as well as the PHP ini file. I am also saving the php experiments into \xampp\xampp\htdocs where the php files that come with xampp are located. This means that my browser can also use these files using the address http://localhost/xampp/filename.php

Finally a great set of tutorials at http://www.tizag.com/mysqlTutorial/mysqlinsert.php that covers mySQL, PHP, HTML and CSS.

I have created a sample database using PHPmyadmin that comes with xampp. I created two tables that could be linked. Then I followed the mySQL tutorial from http://www.tizag.com/mysqlTutorial/mysqlinsert.php but modifying it on the fly to suit the database that I created. This modifying on the fly has been good as I know that I have understood.

The motivation for this posting came from my php script successfully adding three records to one of the tables. Time now to record what I have done.

The thing I want to next is to develop a form to get the data interactively and append it to the table.

Saturday, December 17, 2005

Christmas GIMPing

School finished yesterday for the year and within an hour of that I was told – “I haven’t bothered you cause I know you were busy but I want our Christmas Cards done like last year. I have a Christmas picture and I want our faces put into it.”
This was a time for GIMP again I figured. Last year this exercise taught me about layers but I remember that I had trouble with resizing moving images around inside of a layer. I was concerned that I had not used a graphics program much during the year – how much would I remember?
Well it was a piece of cake and this year I have the moving and resizing of layers down pat. I had some issues with resizing a brush so I made a new one – easy as. This brush could very easily be modified. I also discovered the clone tool and used it to advantage.
I am still very happy with GIMP as my primary graphics editor