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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T10:15:28+00:00 2026-06-02T10:15:28+00:00

Ive been going over this for a couple days and i just cant find

  • 0

Ive been going over this for a couple days and i just cant find the reason it is erroring out. Im not getting a php warning, just the error handler “somethign went wrong” instead of inserting. I know the fine young lads here will probably spot it in a few seconds, esp considering its just a simple insert statement, but im buggered. Thanks in advance.

include('core.inc.php');
$sql = 'INSERT INTO $resultsTable (
    id, 
    firstName, 
    lastName, 
    email, 
    birthday, 
    anniversary,
    location,
    campaign
) 
VALUES (NULL,?,?,?,?,?,?,?)';
$stmt = $mysql->stmt_init();
if ($stmt->prepare($sql)) { 
// bind parameters and execute statement
$stmt->bind_param(
    'sssssss', 
    $_POST['fname'], 
    $_POST['lname'],
    $_POST['email'],
    $_POST['birthday'],
    $_POST['anniversary'],
    $_POST['location'],
    $campaign
);

$OK = $stmt->execute();}
 // return if successful or display error
    if ($OK) {$response = "Success";}
    else {$response ="Something went wrong.";}
}
  • 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-02T10:15:29+00:00Added an answer on June 2, 2026 at 10:15 am

    ok i echoed stmt error and it told me that $resultsTable didnt exist. In core.inc, I have a definition for that variable

    Use concatenation or double quotes.

    $sql = 'INSERT INTO ' . $resultsTable . ' (
        id, 
        firstName, 
        lastName, 
        email, 
        birthday, 
        anniversary,
        location,
        campaign
    ) 
    VALUES (NULL,?,?,?,?,?,?,?)';
    
    
    $sql = "INSERT INTO $resultsTable (
        id, 
        firstName, 
        lastName, 
        email, 
        birthday, 
        anniversary,
        location,
        campaign
    ) 
    VALUES (NULL,?,?,?,?,?,?,?)";
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've been going over this in my head and trying out different approaches for
I've been going at this problem for a solid couple hours now and having
I've been designing a site over the past couple days, and been doing some
I've been driving myself crazy over the past few days over this one. We've
I'm trying to figure out how to design my model. I've been going over
Ive been looking all over but couldn't find anything so I am here to
I've been going crazy trying to figure out why this is happening. The problem
I've been going over and over this in my head, and I can't seem
I've been going over this algorithm and it seams pretty straight forward. I am,
I'm probably missing something really obvious here, but I've been going over this over

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.