<?php
include"config.php";
session_start();
$kind = $_GET['kind'];
$errormsg = '';
if($kind == user)
{ $tablename = "appusers"; }
else
{ $tablename = "developers"; }
if(isset($_POST['setemail'])){
$setemail = $_POST['setemail'];
$sql = mysql_query("SELECT * FROM '$tablename' WHERE email = '$setemail'");
if(mysql_num_rows($sql) > 0)
{
$errormsg = "good";
}
else
{
$errormsg = "not valid";
}
}
?>
我一直无效。当我写没有变量的表名时,它可以工作......