This link code also prompts an error mssql_query():"/> This link code also prompts an error mssql_query():">

Home  >  Article  >  Backend Development  >  PHP and sql server link_PHP tutorial

PHP and sql server link_PHP tutorial

WBOY
WBOYOriginal
2016-07-13 10:51:43888browse




php and sql server link


$conn = dbo.mssql_connect("61.164.111.245","yon","123456");
$dbname = @mssql_select_db("yong1",$conn) ;?>
This link code also prompts the error mssql_query(): 3 is not a valid MS SQL-Link resource in F:yongjiayjadminconn.php on line 3
The database can be connected successfully
Data can also be displayed when updated
I have tested this generation on this machine without any problems
Copy PHP content to clipboard PHP code:
$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();
}
}
?>


But when running on the server,
appeared Warning: mssql_query(): 3 is not a valid MS SQL-Link resource in F:yongjiayjaadmindianziup.php on line 107

[ ]

Let me answer




D8888D reply content------------------------------------------------- ----------
I have never used the DBO class, but the root cause of the problem must be that the database is not connected. After connecting, if the connection fails, display the error and then find the reason

D8888D reply content------------------------------------------------- ----------
mixed mssql_query ( string query [, resource link_identifier [, int batch_size]] )

There is a problem with the database link. The current link is not a legitimate link.

D8888D reply content------------------------------------------------- ----------
What you said means you didn’t say it. I also know what went wrong
How to solve it

D8888D reply content------------------------------------------------- ----------
linux server? You need to install freetds and check the relevant information


www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/632559.htmlTechArticlephp and sql server link $conn = dbo.mssql_connect("61.164.111.245","yon","123456 "); $dbname = @mssql_select_db("yong1",$conn) ;?> This link code also prompts the error mssql_query():...
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn