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

  • Home
  • SEARCH
  • 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 4530680
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T13:49:37+00:00 2026-05-21T13:49:37+00:00

I am learning Extjs along with PHP and MySQL for one of my web

  • 0

I am learning Extjs along with PHP and MySQL for one of my web development course in college right now, and I am very close to finishing my final project for the class and I am stuck on something as simple as a checkbox. I am more into c# programming, so my c# mindset is clashing with the necessities of ExtJS.

The program asks hospital patients a vast amount of questions about their day-to-day feelings, and I have a list of Checkboxes for common symptoms and I need to be able to check to see, once they submit the form, which symptoms were checked and add that symptoms id to the symptoms array.

Is this even close?

    if(headacheCheckbox.getValue()==true){
        symptoms[headacheCheckbox.getId()];
    }

on the Server Side I have

        $id=$dbh->lastInsertId();
        $symptom=$_REQUEST['symptoms'];
        while($tmp=$symptom->fetch()){
        $stmt=$dbh->prepare("insert into symptom_input (inputid, symptomid) values (?,?)");
        $stmt->bindParam(1, $id);
        $stmt->bindParam(2, $tmp);
        $stmt->execute();
        }

and I have my ajax request in my ExtJS taking in the symptom array as a parameter like so..

    params: {action: 'create_input',
        symptoms: symptoms[],
        },

Absolutely any help/criticism is welcome.

Thank You!

  • 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-21T13:49:37+00:00Added an answer on May 21, 2026 at 1:49 pm

    This line

     $symptom=$_REQUEST['symptoms'];
    

    and this line

     while($tmp=$symptom->fetch()){
    

    do not compute.

    fecth is method ffor prepared statement object http://il2.php.net/manual/en/mysqli-stmt.fetch.php (when you fetchign a result set, similar to mysql_fecth_row for unprepared statements) while you have an array parsed to this variable $symptom=$_REQUEST['symptoms']; So your fetch will throw an error in while

    assuming that your array looks like this

    $_REQUEST['symptoms'][112];
    $_REQUEST['symptoms'][234];
    

    what you need is something like this

      $id=$dbh->lastInsertId();
      $symptom=$_REQUEST['symptoms'];
    
       foreach($symptoms as $symptomid){
            $stmt=$dbh->prepare("insert into symptom_input (inputid, symptomid) values (?,?)");
            $stmt->bindParam(1, $id);
            $stmt->bindParam(2, $symptomid);
            $stmt->execute();
            }
    

    Also when passing a parameters

    assuming that code bellow is creating an array in your JavaScript

    if(headacheCheckbox.getValue()==true){
            symptoms[headacheCheckbox.getId()];
        }
    

    you need to

    params: {action: 'create_input',
            symptoms: symptoms //without square brackets and no comma IE7 will throw an error
            },
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

learning Jquery and integrating with PHP - getting there, but have one last challenge
Im learning javascript right now, so this might be a really newb question! I
I am learning extjs and I am curious on how to add an XTemplate
Learning jquery, so please be kind :) Using PHP, I have a table with
Learning php! I have a sql database which contains a table called 'images' which
I'm in the process of learning ExtJS after using JQuery for years. I like
I come from an ExtJS background and am slowly learning jQuery. I am trying
Learning about Explicit Cursors and trying to create my frst one.: SET SERVEROUTPUT ON
learning python, coming from a php background. Keeping it short. Is there a way
I am currently using a EXTJS EditorGridPanel in my application, and for one of

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.