Friday, January 25, 2008

More Java

I'm still working on the Java program, and after a very dumb half an hour yesterday (sorry Graeme!) I now have the MAC code and all the Java code works together and prints out in the command line asking for a user name and prints out the MAC address. But now it doesnt print out on my php page so I'm once agin confused. I think it's because I have more than one Java file I'm not sure so I'll troubleshoot this and see what information I can find.

Wednesday, January 23, 2008

Java fun

Just an update on what I've done recently, admittedly it's not much with the first week and the fact that it was Java I needed to do!
At the moment I have two seperate Java programs, one can read in input from the command line which I need to get a username.
The second is a program that communicates with php, at the moment it's a simple hello world test that prints to my web page but I have it working so shouldn't be too bad to get it to do what I want.
So I've saved the best till last, to get the MAC address through Java.

Monday, January 21, 2008

Meeting - 18/01/08

On Friday I had a meeting with Steve and Graeme, they helped solve my problem with the database taking in the usernames and showing their most recent time, the php can now take in any number of users and output their max times.

I had to make a few minor changes to my code, just clean it up a bit.

My next task is to write some java code that takes in a username string and obtains the MAC address, thank you Graeme for sending on the code to help with that section! I'll have to look into how to connect to the web from java such as httprequest or something.
Then I'll have another php page that gets the username and MAC address from the java code and it will then send this to the database.

Thursday, January 17, 2008

yaaay

So the for loops and all that was hurting my head and I tried two different queries in the one php file and when I had it for my name it printed nothing as I didnt have the Max(time) the other user did. This was a problem but Colin was the bestest and helped me so I used ASC LIMIT which prints out the two most recent times and it works woop woop. I'm going to add another user to see if it still works for more users.
The code needs to be cleaned up but that can wait.

Wednesday, January 16, 2008

I'm stuck

So the printing out a line for each person is hard and I'm officially stuck, I used the MAX(time) method and that works for only the most recent obviously, so it only prints out "Christine was last seen at home at [maxtime]".
I tried a few other methods I think the LIMIT method could be a possibility but I wasn't able to incorporate it into my code.
I was thinking maybe there could be a way to have a query for each person to print out their max times but once again I'm not sure how to go about this, any ideas?

Tuesday, January 15, 2008

I got my table printing out stuff in order of the most recent input, that was ruining my life for a while but I've gotten to grips with how time works in sql, I had to change it back to TIMESTAMP but it doesn't seem to be a problem.

I've been trying to get it to print out the most recent input rather than all of the fields and it now prints out the most recent one, I'll have to do a bit more to get it to print out a line for each person but hopefully that won't be as time consuming as the other one which turned out to be one line of SQL code

Saturday, January 12, 2008

Database Fun

Yesterday I added some test data to my two tables and I have a php page displaying fields from both tables in a table, e.g., Name, Location, Time using the SELECT keyword, i preferred this over the JOIN keyword. I have to change it from text into sentences like Christine was at home at 1.20p.m.
At the moment it just prints out everything that is the same in both tables so I have to get it to print out the recent location added by someone. I had my 'time' field as type TIMESTAMP but apparently this doesn't work well with comparisons so I'll have to change that probably to DATETIME. TIMESTAMP was handy because it printed out the date and time by default, hopefully DATETIME does this too.
I'll probably need to alter my database a little once most things are working, like the IP address is of type TEXT so it takes in anything at the moment but that's not hugely important right now, also the collation default in phpmyadmin is swedish for some random reason but it works in english so i'll leave it!

Friday, January 11, 2008

First meeting of 2008

I met with Graeme and Steve yesterday to discuss my progress and what I need to do next with regards to my database.
I need to input some test data and work from that to get stuff working, i'll need to have two tables in my database using each other to get all the information required, one table will have ID, IP address and location e.g., HOME, SCHOOL etc, the other table will have ID, IP address and the time it was last updated.
I'll then need to have the two tables working together and printing out a line for each person, e.g., Christine was at home at 1.20 p.m.
Once I have that working I can try to find a way to obtain the IP address rather than typing it in manually.

Wednesday, January 9, 2008

Database Interactions

I have my website getting the information inputted by a user and storing it in my database using PHP and today I did the opposite, I can now also display the contents of my database on a web page so I'm a happy camper.
I have to think more about my database now and decide what needs to be stored in it.
I have a meeting tomorrow so there'll be a huge long blog to write after that more than likely.

Friday, January 4, 2008

Christmas is over, sob

So I started work yesterday and I got my Chapter 2 draft finished and have included my abstract and stuff in the final report template.

Today's goal was to fix up my simple php file as the input from my html form wasn't outputting to another php file but I have that fixed and working now although it is very basic but as long as it's working that's enough for me at the moment.

The next task is to try and get my php file to interact with my database. Not quite sure to go about this but google will be my friend and I'll read up on it.