My generation is here"/> My generation is here">
Home > Article > Backend Development > A php update problem_PHP tutorial
A php update problem
$conn = dbo.mssql_connect("61.164.111.245","yon","123456");
$dbname = mssql_select_db("yong1",$conn) or die ("Database does not exist or is unavailable");
?>
I have tested this generation on this machine without any problems
$action=$_POST["action"];
if ($action=="Submit"){
$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);//This is line 107
if($query){
echo"";
mssql_close();
}
}
?>
I copied the code but when I ran it on the server,
appeared.
Warning: mssql_query(): 3 is not a valid MS SQL-Link resource in F:yongjiayjaadmindianziup.php on line 107
[ ]
The best answer [url=http://www.111cn.cn/bbs/space.php?username=E网Xiaoyao]Link tag EwangXiaoyao[/url]
[url=http://www.111cn.cn/bbs/space.php?uid=58710]Link tag[img]http://www.111cn.cn/server/avatar.php?uid=58710&size=small[ /img][/url] The sql server does not start or the SQL ID is wrong. The reason is that you have the SQL SERVER service on your local machine but not on the space, or you have a default link on your local machine and do not need mssql_connect to establish a link. There is no space
[ ]
D8888D reply content------------------------------------------------- ----------
The sql server does not start or the SQL ID is wrong. The reason is that you have the SQL SERVER service on your local machine but not on the space. Or you have a default link on the local machine and do not need mssql_connect to establish a link, but there is no connection on the space
[ ]
D8888D reply content------------------------------------------------- ----------
Where is the code to connect to the database?
D8888D reply content------------------------------------------------- ----------
Is the database used by the server sql server?
D8888D reply content------------------------------------------------- ----------
$exec="update anew set title='".$title."', come='".$come."', exitt='".$exitt."', content='".$content."' , uptime='".$uptime."' where id='".$id,"'";
Copy the code and try it like this. I guess $id is used as a link.
D8888D reply content------------------------------------------------- ----------
I’m dizzy, the connection is not even initialized
D8888D reply content------------------------------------------------- ----------
The link code is posted. Come and take a look. I’m going crazy
D8888D reply content------------------------------------------------- ----------
$conn = mssql_connect("61.164.111.245","yon","123456");
$dbname = mssql_select_db("yong1",$conn) or die ("Database does not exist or is unavailable");
echo $conn;
//If that doesn’t work, contact your ISP and ask him to enable the MSSQL extension for you. I’ve never used DBO before
?>
Copy code
D8888D reply content------------------------------------------------- ----------
Enable MSSQL extension
Why is it open
I manage the server myself
If it were managed by someone else, I would have called them and asked them to take care of it