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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T18:00:25+00:00 2026-06-15T18:00:25+00:00

I am extremely new to PHP. I’d like to use prepared PDO statements, but

  • 0

I am extremely new to PHP. I’d like to use prepared PDO statements, but mine isn’t working. I tried to follow a simple example at

Here’s what I have below(and yeah, I know range, range2, and spellrange all refer to the same thing, but I realized I got errors when I called the field in MySQL “range”, so I changed the field to ‘spellrange’ in the database) – I did an echo of the POST stuff sent to the page (echo now removed), and I am getting all the POST information successfully – Here’s the error:

SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') WHERE id='747')' at line 2

The id=747 is correct. That’s the ID I clicked on from the previous page, and it does exist in the database.
Hope I’m not too lame here, but I was trying to follow the example on that web site (which seemed like the simplest one I saw).

    <?PHP
// MAIN PROCESSING SECTION
    $id = $_POST['id'];
    $level = $_POST['level'];
    $specialty = $_POST['specialty'];
    $name = $_POST['name'];
    $cost = $_POST['cost'];
    $bcu = $_POST['bcu'];
    $range2 = $_POST['range'];
    $prereq = $_POST['prereq'];
    $description = $_POST['description'];

try {
$sql = "UPDATE tblspells 
    SET level=?, specialty=?, name=?, cost=?, spellrange=?, basecostuses=?,  prereq=?, description=?) WHERE id=?)";
    $q = $pdo->prepare($sql);
    $q->execute(array($level, $specialty, $name, $cost, $range2, $bcu, $prereq, $description, $id));
}
    catch(PDOException $e)
    {
        echo "Error ---------- " . $e->getMessage();
    }
?>
  • 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-15T18:00:26+00:00Added an answer on June 15, 2026 at 6:00 pm

    for starter, You have extra closing brackets after 'description' and where clause.

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

Sidebar

Related Questions

I am EXTREMELY new to the html/php scene but I have been working at
I'm extremely new to CakePHP. From what I've gathered, it seems like I can
I'm somewhat new to OpenGL. I've used it for extremely simple stuff like rendering
I'm extremely new to PHP and my first project was developing a comment system.
I'd like to write a new website from scratch. I'll be using PHP for
I'm a PHP dev and I'm new to Rails but have been getting on
First of all, I am extremely new to PHP, so I am still trying.
So currently I'm working on a project that requires the use of PHP and
I am extremely new to php and database. Suddenly I'm handed down this community
I'm extremely new to php and I am trying to get how many lines

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.