我的代码无效......它只返回500错误:(
function getfromdb($select, $tablenme, $wherewhat, $whereval) {
$msntps = $conn->query("SELECT $select FROM $tablenme WHERE $wherewhat = '$whereval'")->fetch_object()->$selectval;
return $msntps;
}
然后我希望得到一些
echo getfromdb("email", "users", "username", "testusername");