0

I have a problem where I get no errors nothing it all goes though as if nothing was wrong! I had all this working then all of a sudden it just stopped working. All my other SQL stuff works on my script apart from this:

// Submit the form and enter the details into the database
    $result = $dbc->prepare('INSERT INTO users (user_name, pwd, date, user_level) values(?,?,?,?)');
    $result->bind_param('sssi', $username, $hash, $now, $userlevel);
    printf("Errormessage: %s\n", $result->error);
    $result->execute();
    $result->close();

It returns no errors nothing. Its very strange. Nothing is inserted into the DB.

1
  • Try outputting the error after execute as well. One thing that stands out is that date is a reserved word Commented Jun 17, 2012 at 15:25

1 Answer 1

1

Maybe first execute, then check the error message?

    $result = $dbc->prepare('INSERT INTO users (user_name, pwd, date, user_level) values(?,?,?,?)');
    $result->bind_param('sssi', $username, $hash, $now, $userlevel);
    $result->execute();
    printf("Errormessage: %s\n", $result->error);
    $result->close();
Sign up to request clarification or add additional context in comments.

1 Comment

That got it! was due to me forgetting to remove a unused column in the DB. It threw the error (After putting the error script in the right place!) thanks :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.