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!