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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T04:44:07+00:00 2026-06-10T04:44:07+00:00

im working on PDO’s, i’ve been trying on this for many hours but still

  • 0

im working on PDO’s, i’ve been trying on this for many hours but still couldn’t succeded to insert the inputs into the database. I dont get any errors, hence i get my $err -> succeded message. But no chance on inserting to database…

Would be glad if you can help.

note: about the user id, im getting the id from another table, column userid, and trying to insert it to another table, “params_user_id” column.

Here is my code :

if(isset($_POST["create"])) {
try{

$param1 = cleanInput($_POST["param1"]);
$param2 = cleanInput($_POST["param2"]);
$param3 = cleanInput($_POST["param3"]);
$param4 = cleanInput($_POST["param4"]);
$param5id = cleanInput($_POST["param5id"]);
$param6id = cleanInput($_POST["param6id"]);
$param7 = cleanInput($_POST["param7"]);
$param8id = cleanInput($_POST["param8id"]);
$param9 = cleanInput($_POST["param9"]);
$param10 = cleanInput($_POST["param10"]);
$param11 = cleanInput($_POST["param11"]);
$param12 = cleanInput($_POST["param12"]);
$param13 = cleanInput($_POST["param13"]);
$param14 = cleanInput($_POST["param14"]);
$param15 = cleanInput($_POST["param15"]);
$param16 = cleanInput($_POST["param16"]);
$param17 = cleanInput($_POST["param17"]);
$param18 = cleanInput($_POST["param18"]);
$param19 = cleanInput($_POST["param19"]);
$param20 = cleanInput($_POST["param20"]);
$param21 = cleanInput($_POST["param21"]);
$userid = $_SESSION[':userid'];
$datenow = date('Y-m-d H:i:s');


$create_params_query = "INSERT INTO `params`(`datenow`, `param1`, `param2`, `param3`, `param4`, `param5id`, `param6id`, `param7`, `param8id`, `param9`, `param10`, `param11`, `param12`, `param13`, `param14`, `param15`, `param16`, `param17`, `param18`, `param19`, `param20`, `param21`,`params_user_id`) VALUE(:datenow, :param1, :param2, :param3, :param4, :param5id, :param6id, :param7, :param8id, :param9, :param10, :param11, :param12, :param13, :param14, :param15, :param16, :param17, :param18, :param19, :param20, :param21, :userid)";

$create_params_do = $db->prepare($create_params_query);
$create_params_do -> bindParam(':datenow', $datenow, PDO::PARAM_STR);
$create_params_do -> bindParam(':param1', $param1, PDO::PARAM_STR);
$create_params_do -> bindParam(':param2', $param2, PDO::PARAM_STR);
$create_params_do -> bindParam(':param3', $param3, PDO::PARAM_STR);
$create_params_do -> bindParam(':param4', $param4, PDO::PARAM_STR);
$create_params_do -> bindParam(':param5id', $param5id, PDO::PARAM_INT);
$create_params_do -> bindParam(':param6id', $param6id, PDO::PARAM_INT);
$create_params_do -> bindParam(':param7', $param7, PDO::PARAM_STR);
$create_params_do -> bindParam(':param8id', $param8id, PDO::PARAM_INT);
$create_params_do -> bindParam(':param9', $param9, PDO::PARAM_STR);
$create_params_do -> bindParam(':param10', $param10, PDO::PARAM_STR);
$create_params_do -> bindParam(':param11', $param11, PDO::PARAM_STR);
$create_params_do -> bindParam(':param12', $param12, PDO::PARAM_STR);
$create_params_do -> bindParam(':param13', $param13, PDO::PARAM_STR);
$create_params_do -> bindParam(':param14', $param14, PDO::PARAM_STR);
$create_params_do -> bindParam(':param15', $param15, PDO::PARAM_STR);
$create_params_do -> bindParam(':param16', $param16, PDO::PARAM_STR);
$create_params_do -> bindParam(':param17', $param17, PDO::PARAM_STR);
$create_params_do -> bindParam(':param18', $param18, PDO::PARAM_STR);
$create_params_do -> bindParam(':param19', $param19, PDO::PARAM_STR);
$create_params_do -> bindParam(':param20', $param20, PDO::PARAM_STR);
$create_params_do -> bindParam(':param21', $param21, PDO::PARAM_STR);
$create_params_do->bindParam(':userid', $userid, PDO::PARAM_INT);

$create_params_do->execute() or die(print_r($create_params_do->errorInfo(), true));
//forgot to add when posting first sorry, i have that also.
}
catch(PDOException $e) {
$log->logError($e." - ".basename(__FILE__));
}


$err = "<div class=\"success\"><strong>"._("Congrats.")."</strong><br/>"._("Success.")."</div>";
}
  • 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-10T04:44:08+00:00Added an answer on June 10, 2026 at 4:44 am

    You are missing

    $create_params_do->execute();
    

    at the end of params

    Your query should be:

    $create_params_query = "INSERT INTO `params`(`datenow`, `param1`, `param2`, `param3`, `param4`, `param5id`, `param6id`, `param7`, `param8id`, `param9`, `param10`, `param11`, `param12`, `param13`, `param14`, `param15`, `param16`, `param17`, `param18`, `param19`, `param20`, `param21`,`params_user_id`) VALUES(:datenow, :param1, :param2, :param3, :param4, :param5id, :param6id, :param7, :param8id, :param9, :param10, :param11, :param12, :param13, :param14, :param15, :param16, :param17, :param18, :param19, :param20, :param21, :userid)";
    

    with VALUES not VALUE

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

Sidebar

Related Questions

I am still working with securing my web app. I decided to use PDO
I am trying to get the PHP PDO driver for SQL server working. I
I'm trying to switch to pdo and have enjoyed success with it but my
Okay, so I have been using a PDO wrapper for a project I'm working
I´m rewritting our database class (PDO based), and got stuck at this. I´ve been
Why is this PDO query not working properly? $colors = $_GET['color']; $colors = explode('
I'm using PDO in my application. But I have a problem while I'm working
I'm using PDO::query to run the following SQL statement: INSERT INTO pages (template_id,user_id,page_default,page_internal_title,page_menu_text,page_nav_link,globalcontent_id,page_parent_id,page_order,page_active,page_show_in_menu,page_hide,page_created,page_updated,page_deleted,page_type) values
I am working on this project in which I am trying to get a
I have experience about PDO but I was working with MySQL so far. I

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.