我试图允许我的网站用户通过Steam登录,当你转到steam api并登录时,你会被重定向到显示错误的页面" MySQL错误:未选择数据库"这是我正在使用的代码和它期望的参数:
<?php
$sitename = "http://www.jackpot-skins.co.uk/";
$link = mysql_connect("localhost", "USERNAME", "PASSWORD");
$db_selected = mysql_select_db('database', $link);
mysql_query("SET NAMES utf8");
function fetchinfo($rowname,$tablename,$finder,$findervalue) {
if($finder == "1") $result = mysql_query("SELECT $rowname FROM $tablename");
else $result = mysql_query("SELECT $rowname FROM $tablename WHERE `$finder`='$findervalue'");
$row = mysql_fetch_assoc($result);
return $row[$rowname];
}
?>
目前我的设置如下:
<?php
$sitename = "jackpot-skins.co.uk/";
$link = mysql_connect("localhost", "jackp574_admin", "(my actual password");
$db_selected = mysql_select_db('jackp574_database', $link);
mysql_query("SET NAMES utf8");
function fetchinfo($rowname,$tablename,$finder,$findervalue) {
if($finder == "1") $result = mysql_query("SELECT $rowname FROM $tablename");
else $result = mysql_query("SELECT $rowname FROM $tablename WHERE `$finder`='$findervalue'");
$row = mysql_fetch_assoc($result);
return $row[$rowname];
}
?>
出于某种原因,我仍然得到错误,任何想法?