class.php
class Database {
function select_user($formation,$department,$table)
{
if(($formation=="Select All") and ($department=="Select All"))
{
$select_user=mysql_query("SELECT * FROM ". $table . " order by dateofjoin DESC");
echo "SELECT * FROM ". $table ." order by dateofjoin DESC";
}
else
{
$query="SELECT * FROM". $table ." WHERE formation='$formation' and department='$department' order by dateofjoin DESC";
//echo "SELECT * FROM ". $table ." WHERE formation='$formation' and department='$department' order by dateofjoin DESC";
return ($query);
}
}
在 viewtudent.php 中,我正在为类似的函数争论
$obj= new Database;
$obj->select_user($_POST['formation'],$_POST['department'],'user');
所以请告诉我如何从 class.php,,thx,,, 中获取值