Reading book called the joy of php

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Mark1954
Forum Newbie
Posts: 7
Joined: Fri Dec 17, 2021 3:39 pm

Reading book called the joy of php

Post 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
User avatar
Benjamin
Site Administrator
Posts: 6935
Joined: Sun May 19, 2002 10:24 pm

Re: Reading book called the joy of php

Post by Benjamin »

Line 57 is missing a )
Post Reply