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 6064003
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T09:13:57+00:00 2026-05-23T09:13:57+00:00

I know this topic has been beaten into the ground, but I’m really stumped.

  • 0

I know this topic has been beaten into the ground, but I’m really stumped. I can’t figure out why I’m getting an unexpected } error.

My problem is with a code snippet I’ve added to a Paypal credit card terminal script. It captures the form data into a MySql database so we can keep track of billing address information, etc. It works until I add an IF statement that is supposed to only send the data to MySQL if Paypal successfully successfully captures the card info. I want to do it this way because even if the form fails to capture the CC info, it will still be added to the database as if it were successful.

Here’s the code. Again, it works until I add the if($ack="SUCCESS") { and the corresponding closing brace at the end. If I remove the brace, I get an unexpected end error.

What is the error? In Notepad++ everything looks like it matches up.

if($ack="SUCCESS")  {   
    $con = mysql_connect("localhost", "dbname", "dbpassword");
    if (!$con)
        {
        die('Could not connect: ' . mysql_error());
        }
    mysql_select_db("contributors", $con);
    $sql="INSERT INTO contributor_information (service, fname, lname, email, address, city, country, state, zip)
    VALUES
    ('$_POST[service]','$_POST[fname]','$_POST[lname]','$_POST[email]','$_POST[address]','$_POST[city]','$_POST[country]','$_POST[state]','$_POST[zip]')";
    if (!mysql_query($sql,$con))
        {
        die('Error: ' . mysql_error());
        }
    mysql_close($con)
}
  • 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-05-23T09:13:57+00:00Added an answer on May 23, 2026 at 9:13 am

    You need a semi-colon after mysql_close($con).

    You need quotes in your POST variables – $_POST[’email’] and so on.

    You need to run your POST variables through mysql_real_escape_string.

    You need to use comparison instead of assignment ( if($ack=="SUCCESS") instead of if($ack="SUCCESS") )

    Curly braces are the least of your worries, really.

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

Sidebar

Related Questions

I know this topic has been asked, but the posts are all out of
I know this has been a hot topic over the time... but I can't
I know that this topic has been beaten to death, but it seems that
I know that this topic has been already beaten enough, but I still don't
Know this might be rather basic, but I been trying to figure out how
I know this topic has been discussed to death, but there is one thing
Ok so I know this topic has many questions, but I still haven't been
I know this topic has been beat to death but a lot of the
I know this topic has been approached several times before in various ways, but
I know a similar question on this topic has been asked, but doesn't look

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.