An error occurred while requesting the verification. it cannot be found. & lt ;! DOCTYPEhtmlPUBLIC & quot;-// W3C // DTDXHTML1.0Transitional // EN & quot; The http://www.w3.org/TR/xhtml1/DTD/xhtml1-tran cannot be found
Untitled Document
$ Conn = mysql_connect ("localhost", "root", "5200 ");
If (! $ Conn ){
Die ("connection failed". mysql_error ());
}
Mysql_select_db ("blog", $ conn) or die (mysql_error ());
Mysql_query ("set names utf8 ");
$ SQL = "select * from article ";
$ Res = mysql_query ($ SQL );
While ($ row = mysql_fetch_assoc ($ res )){
Echo ""; 41
Echo"
$ Row ['article _ title']
";
Echo"
$ Row ['article _ body']
";
Echo "";
}
?>
Show error
Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in D: \ wamp1 \ www \ blog \ index. php on line 41
I wrote it clearly, but it is still this error .. Explanations
------ Solution --------------------
Echo ""; 41
Is this error invisible? Echo "not clear yet? The correct method is to escape double quotation marks in a string \"
The following statements are correct:
PHP code
// Escape double quotation marks echo ""; // use single quotation marks to prevent the double quotation marks in the string from conflicting echo ''; // for convenience, use echo <------ Solution --------------------
Echo ""; // 41
Echo"$ Row ['article _ title']
";
Echo"$ Row ['article _ body']
";
Echo "";
Change
Echo <HTML
$ Row [article_title]
$ Row [article_body]
HTML;
Simple and clear
Remember! The final HTML.