hi please i need your help with some codes i have written they re working but i need efficiency pls if there re better ways or points i need to work on please show me :
function one_venue($time ,$venue,$date,$ code){
$qry="select * from timetable where time='$time' and date='$date' and venue='$venue'" ;
$rst=mysql_quer y($qry) or die (mysql_error()) ;
if(mysql_num_ro ws($rst)>0){
$msg="An Event is holding in".$venue."at" .$time.".! Please fix this event for another time or venue";
return $msg;
}
else{
one_class($time ,$code,$date);
}
}
function one_class($time ,$code,$date){
$qry="select * from timetable where time='$time' and date='$date' and code='$code'";
$rst=mysql_quer y($qry) or die (mysql_error()) ;
if(mysql_num_ro ws($rst)>0){
$msg="An Event has been scheduled for this class at this time (".$time.")! . Please fix this event for another time";
}
else{
$msg="The event has been registered successfully!";
}
return $msg;
}
function one_venue($time ,$venue,$date,$ code){
$qry="select * from timetable where time='$time' and date='$date' and venue='$venue'" ;
$rst=mysql_quer y($qry) or die (mysql_error()) ;
if(mysql_num_ro ws($rst)>0){
$msg="An Event is holding in".$venue."at" .$time.".! Please fix this event for another time or venue";
return $msg;
}
else{
one_class($time ,$code,$date);
}
}
function one_class($time ,$code,$date){
$qry="select * from timetable where time='$time' and date='$date' and code='$code'";
$rst=mysql_quer y($qry) or die (mysql_error()) ;
if(mysql_num_ro ws($rst)>0){
$msg="An Event has been scheduled for this class at this time (".$time.")! . Please fix this event for another time";
}
else{
$msg="The event has been registered successfully!";
}
return $msg;
}