For calling in a function from what i can gather is use your code but add the words function to it at the top and then close curlies at the bottom of the function like below
function querystudent(){
$query = "SELECT studentevent
FROM tblgroup
WHERE groupID = '$groupID'";
$result = mysql_query($query) or die ("Query failed: $query - " . mysql_error());
if ($myrow = mysql_fetch_array($result) && $myrow[studentevent] == 1) { // see if we got 1 or more rows returned
echo "this is a student event";}
else{
echo "this is not a student event";
}
//ending curlie for function below
}
and then in you rpage where you wish to call this function just type
<?php querystudent(); ?>
and that will call the function if you have saved the query in another page you will have to include that page using somethign similar to this
include_once('path to file here');
in the page where you are calling that function.
I hope that this helps.
Regards Pinky