I do also validate $type
, and use get/set
.
private function somfunc($sql) {
// query and return result set as an array
}
private function mytype($type) {
switch ($type)
case topic: $sql="......";
return sql;
}
public function display($type) {
// switch case to require template
// call somefunc and mytype here
}
If it's not secure, how do I improve my code?