Leena,
What I normally do is to urlencode all variables that can contain special characters. You don't have to do this to numeric variables, only variables that contain text. I am aware that this is extra work, but it ensures data integrity.
Before you create the $queryStr variable, you should urlencode the variables, like this:
$address=urlencode($address);
$city=urlencode($city);
$name=urlencode(name);
$school=urlencode($school);
etc...
and then:
$queryStr="UPDATE teachers SET name='$name', school='$school', address='$address', city='$city', zip='$zip', work='$work', home='$home', fax='$fax', email='$email', URL='$url', totalStrand='$totalStrand' WHERE (resourceID='$resourceID')";
mysql_query($queryStr) or die (no way Jose...);
Two notes here, there are some errors in the querystring. First. you don't have to update the resourceID, so I removed that one. Second, there was a closing quote missing in the home variable.
To retrieve data, you have to urldecode the data that you encoded.
$queryStr="select * from teachers where (resourceID='$resourceID')";
$teacherResult=mysql_query($queryStr);
$array=mysql_fetch_array($teacherResult);
$address=stripslashes(urldecode($array["address"]));
$city=stripslashes(urldecode($array["city"]));
etc...
Regs,
Dik