Page 1 of 1

Reading book called the joy of php

Posted: Fri Dec 17, 2021 3:50 pm
by Mark1954
HI Everyone,

I am reading this book. It shows me how to build a website. This has my interest. However, I am stuck. I have copied code from the book to create a database.
First, here is the error I am getting. Parse error: syntax error, unexpected token "echo" in C:\Apache24\htdocs\createdb.php on line 59.

And here is a swatch of code where the so called error lies:

57 if($mysqli->query($query)=== TRUE
58 {
59 echo"<p>Honda Pilot inserted</p>";
60 }
61 else
62 {
echo "<p>Error inserting Honda Pilot:</p>".$mysqli->error;
echo"<p>*********</p>";
echo $query;
echo "<p>**********</p>";
}

There error posted in my browser is the echo "<p>Honda Pilot inserted</p>";

Any help will be appreciated.
Mark

Re: Reading book called the joy of php

Posted: Sat Dec 18, 2021 11:02 am
by Benjamin
Line 57 is missing a )