I think that was just the method I was looking for bannme, it should work but I keep getting an sql error and I do not know why ! If I echo the query then hard code it into the script it works great but if I use the variables it dose not.
I will let you know how I get on later as I am in the middle of formatting my PC etc. at the moment and have brought a broken hard drive
Anthony