PHP Fatal error: Call to a member function query() on a non-object in F
2个回答
展开全部
XXX -> query()
里边的XXX不是对象,或是XXX对象初始化失败。
里边的XXX不是对象,或是XXX对象初始化失败。
追问
$db=mssql_connect("XXX","XXX","XXX") or die ("can not Connect to Database");
mssql_select_db("XXX");
echo "Success....";
$rows = $db->query('SELECT * FROM rainday');
那该怎么改 $rows?
追答
$link = mssql_connect("XXX","XXX","XXX");
if (!$link || !mssql_select_db("XXX", $link)) {
die('Unable to connect or select database!');
}
$rows = mssql_query('SELECT * FROM rainday');
foreach($row = mssql_fetch_array($rows))
{
var_dump($row);
}
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询