Php and sqlserver link _ PHP Tutorial-php Tutorial

Source: Internet
Author: User
Link between php and sqlserver. Link between php and sqlserver $ conndbo. mssql_connect (61.164.111.245, yon, 123456); $ dbname @ mssql_select_db (yong1, $ conn );? This link code also prompts the error mssql_query (): Link between php and SQL server

$ Conn = dbo. mssql_connect ("61.164.111.245", "yon", "123456 ");
$ Dbname = @ mssql_select_db ("yong1", $ conn);?>
This Link code also prompts 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 as updating
I have not encountered any problems in the local testing of this generation.
Copy the PHP content to the 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); // The value is 107 rows.
If ($ query ){
Echo "";
Mssql_close ();
}
}
?>


However, when the server is running
Warning: mssql_query (): 3 is not a valid ms SQL-Link resource in F: yongjiayjadmindianziup. php on line 107

[]

Let me answer




D8888D reply content -------------------------------------------------------
The DBO class has never been used. However, the root cause of the problem must be that the database is not connected. if the connection fails after the connection, the error is displayed and the cause is found.

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 valid link.

D8888D reply content -------------------------------------------------------
You did not say it. I also know that something went wrong.
How can this problem be solved?

D8888D reply content -------------------------------------------------------
Linux server? Install freetds and check related information.


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 ():...

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.