What is wrong with this "for dummies" PHP code? -


I am running PHP5 on a free web server and I try to read PHP to read the "Dummy" book I am ... it gives me some code to run and due to some cruelty I get errors on every line of HTML.

Here the code is I. Features have been expired but they are correct:

    gt; & gt; Test MySQL & lt; / Title & gt; & lt; / head & gt; & lt; body & gt; "; $ Host = "XXXX"; User $ = "XXXX"; $ Password = "XXXX"; $ Cxn = mysqli_connect ($ host, $ user, $ password); $ Sql ​​= "show status"; $ Result = mysqli_query ($ cxn, $ sql); If ($ result == wrong) {echo " Error:". Mysqli_error ($ cxn) "& Lt; / h4 & gt;"; } Else {/ * table which displays results / / resonant "table" = '1' & gt; & Lt; TR & gt; & Lt; Th & gt; Variable_name & lt; / Th & gt; & Lt; Th & gt; Price & lt; / Th & gt; & Lt; / TR & gt; "; ($ I = 0; $ i & lt; mysqli_num_rows ($ result); $ i ++) {resonant" & lt; Tr & gt; "; $ Row_array = mysqli_fetch_row ($ result); ($ J = 0; $ j & lt; mysqli_num_fields ($ result); $ j ++) {resonant" & lt; Td> "$ row_array [$ j]." & Lt; / Td> \ N ";}} echo" & lt; / Table> "?}? & Gt; & lt; / body & gt; & lt; / html & gt;  

Whenever I get the HTML, then this error Or similar:

Parse error: Syntax error, unexpected '>' in / home / a7613610 / Public_html / mysql_up.php on line 6

I want to learn PHP, But when it is believed that errors are reported in good code, then I do not want it.

The code is filled with fancy quotes ( " and " ), which does not match PHP In the can. Use your text editor standard double quote characters ". With to search and replace both characters, though it definitely looks like you're using No to have a plain text editor (see), me Hope you are using one. Word processing and rich text editing software is not designed to write programs and scripts.

OK, so it's great to use Notepad to write your PHP code, but keep in mind that some eBook readers and even some books in the code block Citations make the characters fancy and make them fancy. This is one reason that the code is frozen on copying and pasting;)

In addition, if you want to learn PHP, or in any form of programming in general, then you should be able to get the books and tutorials right Should not be expected;)


Comments

Popular posts from this blog

Eclipse CDT variable colors in editor -

AJAX doesn't send POST query -

wpf - Custom Message Box Advice -