我需要在函数外使用“问题”变量:
public function name(){
if($_SESSION[agT] == "random" AND $_SESSION[ct]=="random"){
$consult = DB::getConn()->prepare('SELECT * FROM table ORDER BY RAND() LIMIT 1');
$consult->execute();
$question=$consult->fetch(PDO::FETCH_ASSOC);
}
喜欢
echo "$question[column];
echo "$question[anothercolumn];