Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
乍一看..您应该在执行查询之前选择 db .. 所以替换
$sql = "SELECT * FROM usergroups"; mysql_select_db('dopetunez');
和
mysql_select_db('dopetunez'); $sql = "SELECT * FROM usergroups";
建议请使用mysqli_和PDO 。mysql_不再维护
您应该首先选择数据库。然后只有您可以访问查询。请改成这样,
$conn = mysql_connect($dbhost, $dbuser, $dbpass); mysql_select_db('dopetunez'); $sql = "SELECT * FROM usergroups";