这段链接代码也是提示错误mssql_query():"/> 这段链接代码也是提示错误mssql_query():">

Heim  >  Artikel  >  Backend-Entwicklung  >  php与sql server链接_PHP教程

php与sql server链接_PHP教程

WBOY
WBOYOriginal
2016-07-13 10:51:43885Durchsuche




php与sql server链接


$conn = dbo.mssql_connect("61.164.111.245","yon","123456");
$dbname = @mssql_select_db("yong1",$conn) ;?>
这段链接代码也是提示错误mssql_query(): 3 is not a valid MS SQL-Link resource in F:yongjiayjadminconn.php on line 3
数据库能连接成功的
数据也能显示出来就是更新时
我这代段在代在本机测试没有出现过问题的
复制PHP内容到剪贴板 PHP代码:
$action=$_POST["action"];
if ($action=="提交"){
$id=$_POST["id"];
$title=$_POST["title"];
$come=$_POST["come"];
$exitt=$_POST["exitt"];
$content=stripslashes(trim($_POST["content"]));
$uptime=$_POST["uptime"];
if($id==""){
echo "";
}
if($title==""){
echo"";
}
if($come==""){
echo"";
}
if($exitt==""){
echo"";
}
if ($content==""){
echo "";
}
if($uptime==""){
echo "";
}
$exec="update anew set title='".$title."', come='".$come."', exitt='".$exitt."', content='".$content."', uptime='".$uptime."' where id=".$id;
$query=@mssql_query($exec);// 此处为107行
if($query){
echo"";
mssql_close();
}
}
?>


但是到了服务器上运行时出现了
Warning: mssql_query(): 3 is not a valid MS SQL-Link resource in F:yongjiayjadmindianziup.php on line 107

[ ]

我来回答




D8888D回贴内容-------------------------------------------------------
没用过DBO类,不过,问题的根源肯定是没连上数据库,连接后,如果连接失败,把错误显示出来,再查找原因

D8888D回贴内容-------------------------------------------------------
mixed mssql_query ( string query [, resource link_identifier [, int batch_size]] )

数据库的链接出问题了。当前链接不是合法的链接。

D8888D回贴内容-------------------------------------------------------
你们说了等于没说.我也知道那里出错了
怎么解决了

D8888D回贴内容-------------------------------------------------------
linux服务器?需要安装freetds查下相关资料吧


www.bkjia.comtruehttp://www.bkjia.com/PHPjc/632559.htmlTechArticlephp与sql server链接 $conn = dbo.mssql_connect("61.164.111.245","yon","123456"); $dbname = @mssql_select_db("yong1",$conn) ;?> 这段链接代码也是提示错误mssql_query():...
Stellungnahme:
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn