How to edit php news? Can someone help me see what's wrong? Thank you.

Source: Internet
Author: User
How to edit php news? Can someone help me see what's wrong? Thank you.
$ Conn = mysql_connect ("localhost", "root", "123");/* database */
Mysql_query ("set names GB2312 ");
$ Db = mysql_select_db ("miaolaor ");
$ SQL = "SELECT * FROM news_listing where news_Id = '$ _ GET [AId]'";
$ Query = mysql_query ($ SQL );
If ($ _ POST ['submit '])
$ SQL = "update news_listing set news_headline = '$ _ POST [news_headline]', news_intro = '$ _ POST [news_intro]', content = '$ _ POST [content]' where news_Id = '$ _ POST [AId]' ";
// $ SQL = 'update' news _ listing 'set 'news _ headline' = \ '$ news_headline \', 'News _ intro' = \ '$ news_intro \', 'content' = \ '$ content \ 'Where 'news _ listing '. 'news _ id' = \ '$ news_Id \';';
Mysql_query ($ SQL); // execute an SQL statement
If ($ SQL ){
Echo "modified successfully ";
Echo "back ";
} Else {
Echo "failed to modify ";
Echo "back ";
}
// Echo $ SQL;
?>


Reply to discussion (solution)

Mysql_query ($ SQL) or die (mysql_error (); // execute the SQL statement

Run the SQL statement in the database.

Change
If (isset ($ _ POST ["submit"])
Try

Are you prompted for any errors? Post the error message

Thanks!

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.