I am a "newbee" I have made a site " bubble under "by reading the book "Built your own Website"Now I am updating the site by adding more features and modules by making use of MYSQL and PHP. Like now I have created a database and want to display a table coming from database.I am referring the sitepoint Book "php__mysql_novice_to_ninja_5th_edition". Its a great book help me in learing PHP and MYSQL in website development.

I have a problem in building scriptAs I want to display all the columns of the club_event table which I made in Localhost server XAmpp and wrote the code as under to retrieve all columnswhile ($row = $result->fetch()){

but I am unable to display all the columns in my website.by below code:

<?php echo htmlspecialchars($club_event , ENT_QUOTES, 'UTF-8'); ?>

If I want to display single column it is working but for all columns to be displayed it is giving an error:Warning: htmlspecialchars() expects parameter 1 to be string, array given in C:\xampp\htdocs\bubble\events.html.php on line 12

but it's still giving the error.and the error it is showing in the line <?php echo htmlspecialchars($club_event, ENT_QUOTES, 'UTF-8'); ?> // This line is on no. 13 and used to display all the elements of club_event table which is stored in another file and included in the main file.

The error message is as displayed in my website is:Warning: htmlspecialchars() expects parameter 1 to be string, array given in C:\xampp\htdocs\bubble\events.html.phpon line 13

I am displaying table "$club_event" <?php echo htmlspecialchars($club_event, ENT_QUOTES, 'UTF-8'); ?> as it is not an array. Also I displayed htmlspecialchars once only during creating array. But i m not able to built an error free script.

where I m doing mistake I m not getting that.Kindly help me solving this issue.

$club_event is an array.$events[] = array('Date' => $row['Date'], 'Description' => htmlspecialchars($row['Event_Description'] , ENT_QUOTES, 'UTF-8'),'Cost' => htmlspecialchars($row['Approximate_Cost'], ENT_QUOTES, 'UTF-8'));$club_event is an element of the $events array, which is itself an array containing three key-value pairs: 'Date','Description', and 'Cost'. Use those keys to access the values of $club_event.

Thanks Mentor :-),as I step forward in my coding...... but there is one issue .i.e. <?php echo htmlspecialchars( $club_event['Date'] ENT_QUOTES, 'UTF-8'); ?>. This piece of code is used to display individual column but wat should I do to display whole table .If I am using these lines to display all columns as :

1: You've erased the comma before ENT_QUOTES. Look at your post in #9, and then at it in #11.

2: There will not be an entry in the array for 'Approximate_Cost', you renamed that to just 'Cost' in post #3.

Thank you so so much Mentor.....as u kept patience and guided me properly ,u let me know my mistakes and treated so well. Thanks as now my code is working properly.Now I have to apply CSS styling and build the database in tabular format. Thanks