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!

No comments: