A php update Problem

Source: Internet
Author: User




A php update Problem

$ Conn = dbo. mssql_connect ("61.164.111.245", "yon", "123456 ");
$ Dbname = mssql_select_db ("yong1", $ conn) or die ("the database does not exist or is unavailable ");
?>

I have not encountered any problems in the local testing of this generation.

$ 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 ();

}

}

?>


Copy the Code but the code appears when it is running on the server.
Warning: mssql_query (): 3 is not a valid ms SQL-Link resource in F: yongjiayjadmindianziup. php on line 107

[]


Best Answer [url = http://www.111cn.cn/bbs/space.php? Username = e] link mark e [/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 is not started or the SQL id is incorrect. The reason is that the local machine has the SQL SERVER service, but the space does not exist, or you have a default link on your local machine, instead of mssql_connect.

[]



D8888D reply content -------------------------------------------------------
SQL server is not started or has an SQL id error because you have the SQL SERVER service on the local machine, but there is no space, or you have a default link on the local machine without the need for mssql_connect to establish a link, no space

[]

D8888D reply content -------------------------------------------------------
Where is the database connection code?

D8888D reply content -------------------------------------------------------
Is the SQL server of the database used by the server?

D8888D reply content -------------------------------------------------------
$ Exec = "update anew set title = '". $ title. "', come = '". $ come. "', exitt = '". $ exitt. "', content = '". $ content. "', uptime = '". $ uptime. "'where id = '". $ id ,"'";


Try copying the code to this. It is estimated that $ id is used as the link.

D8888D reply content -------------------------------------------------------
I'm dizzy. No connection is initialized.

D8888D reply content -------------------------------------------------------
The link code has been posted. Let's see if I'm going crazy.

D8888D reply content -------------------------------------------------------


$ Conn = mssql_connect ("61.164.111.245", "yon", "123456 ");

$ Dbname = mssql_select_db ("yong1", $ conn) or die ("the database does not exist or is unavailable ");

Echo $ conn;

// If not, contact the ISP and ask him to enable MSSQL extension for you. DBO is useless.

?>


Copy code

D8888D reply content -------------------------------------------------------
Enable MSSQL Extension
Why?
The server is managed by myself
If someone else manages them, I call them to get them done.


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.