Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8655337
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T15:00:12+00:00 2026-06-12T15:00:12+00:00

I am trying to see what is wrong with this it says it is

  • 0

I am trying to see what is wrong with this it says it is expecting a ‘]’ but i do not see the problem in my mySQL here is the line it says it is messing up on.

('$_POST[first_name]','$_POST[last_name]','$_POST[email]','$_POST[phone_number]','$_POST[event_name]','$_POST[event_category]','$_POST[event_ description]','$_POST[event_admission]','$_POST[event_amount]',$event_start_date,$event_end_date,'$_POST[event_location]','$_POST[event_family]')";

Here is the full code:

$sql="INSERT INTO events_main (first_name, last_name, email, phone_number, event_name, event_category, event_description, event_admission, event_amount, event_start_date, event_end_date, event_location, event_family)VALUES('$_POST[first_name]','$_POST[last_name]','$_POST[email]','$_POST[phone_number]','$_POST[event_name]','$_POST[event_category]','$_POST[event_description]','$_POST[event_admission]','$_POST[event_amount]','$event_start_date','$event_end_date','$_POST[event_location]','$_POST[event_family]')";
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T15:00:13+00:00Added an answer on June 12, 2026 at 3:00 pm

    The reason why you get the error is because of event_ description; the space shouldn’t be there.

    However, you should use something like this to properly escape your data before saving them in the database:

    $escaped_values = join(',', array_map(function($v) {
        return "'" . mysql_real_escape_string($v) . "'";
    }, array(
        $_POST['first_name'],
        $_POST['last_name'],
        $_POST['email'],
        $_POST['phone_number'],
        $_POST['event_name'],
        $_POST['event_category'],
        $_POST['event_description'],
        $_POST['event_admission'],
        $_POST['event_amount'],
        $event_start_date,
        $event_end_date,
        $_POST['event_location'],
        $_POST['event_family'],
    )));
    
    $sql = "INSERT INTO .... VALUES ($escaped_values)";
    

    It gets even easier with prepared statements, as the escaping is done for you 🙂

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have spent the last hour trying to see what I'm doing wrong, or
I'm trying to see the value of a variable, but the debugger shows me
i'm trying to see if a url exists. here is my code for doing
I've tried learning this but for whatever reason it just does not work. I
probably a simple question here but here we go: I'm trying to publish a
I am trying to fix this product listing: http://shop.crystalvine.com/salt/blueberrysalt-c.html You see in the dropdown
I'm trying to open a file in Windows Phone 7, but it says it
I am trying to see if the user has internet connection when the app
I'm trying to see if there is a way in rails routing to 'return'
I am trying to see if there is an existing row in my sqlite

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.