Advertisement

04.18.2006 at 02:17AM PDT, ID: 21817323
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

4.2

PHP Beginner: adding a new member to a table

Asked by luna621 in PHP and Databases

Tags:

Hello.  I just started learning PHP.  I'm also not very good at programming :(

I want to add a new member to a table in my database.  The table is set up so that the person_id is an automatically incremented number (so with each new member added, the person_id is +1 from the previous person_id).  I don't know how to add the information I pull off a form from a webpage to the database.  I keep getting an error telling me that it's unable to insert into the database.  Everything I have is set up on localhost using Windows XP IIS 5.0 and MySQL Server.  I made a screencap of the ER-diagram I drew of my database.  I'm only using the member and person tables for now (I think): http://img105.imageshack.us/img105/2056/db1do.jpg.  Please let me know what I did wrong, or if you need more information.  Thank you.

Partial coding:
-----------------------------------------------------------

...
  if ($isPostback) {
        $username = getRequestValue("username");
        $password = getRequestValue("password");
        $firstname = getRequestValue("firstname");
        $middlename = getRequestValue("middlename");
        $lastname = getRequestValue("lastname");
        $employer = getRequestValue("employer");
        $graduation_date = getRequestValue("graduation_date");
        $subnewsletter = getRequestValue("subnewsletter");

            $validated = true;

            if ($validated) {
              // $staff_id = $_SESSION["LoggedOnPersonId"];
          $sql = "INSERT INTO person (NULL, username, password, firstname, middlename, lastname) VALUES ";

// person_id is supposed to be on auto-increment

              $sql = $sql."('NULL', '$username', '$password', '$firstname', '$middlename', '$lastname')";

          $sql = "INSERT INTO member (employer, NULL, graduation_date, NULL, subnewsletter, firstname, middlename, lastname, NULL,) VALUES ";

// person_id is supposed to be on auto-increment

              $sql = $sql."('$employer', 'NULL', '$graduation_date', 'NULL', '$subnewsletter', '$firstname', '$middlename', '$lastname', 'NULL', )";

              //echo($sql);
                  $conn = getConnection();
                  if (mysql_query($sql, $conn)) {
                    $feedback = "Activity inserted into database successfully.";
                  }
                  else {
                    $feedback = "Error, unable to insert record into database.";
                  }
            }
            else {
              $feedback = "Invalide input.";
            }
      }
?>

...
        <form name="form1" method="post">
          <p><strong>Member Entry Form </strong></p>

            <table border="0">
            <!-- This gathers information for the person table. -->
          <tr>
            <th>UserName:</th>
            <td><input name="username" id="username"><?php echo(getRequestValue("username"))?></td>
          </tr>
          <tr>
            <th>Password:</th>
            <td><input name="password" id="password"><?php echo(getRequestValue("password"))?></td>
          </tr>
          <tr>
                <th>First Name:</th>
                <td><input name="firstname" id="firstname"><?php echo(getRequestValue("firstname"))?></td>
          </tr>
          <tr>
                <th>Middle Name:</th>
                <td><input name="middlename" id="middlename"><?php echo(getRequestValue("middlename"))?></td>
          </tr>
          <tr>
                <th>Last Name:</th>
                <td><input name="lastname" id="lastname"><?php echo(getRequestValue("lastname"))?></td>
          </tr>
          <tr>
                <th>Employer:</th>
                <td><input name="employer" id="employer"><?php echo(getRequestValue("employer"))?></td>
          </tr>
          <tr>
                <th>Graduation Date:</th>
                <td><input name="graduation_date" id="graduation_date"><?php echo(getRequestValue("graduation_date"))?></td>
          </tr>
          <tr>
                <th>Subscribe Newsletter:</th>
                <td><input name="subnewsletter" id="subnewsletter"><?php echo(getRequestValue("subnewsletter"))?></td>
          </tr>
        </table>
          <br>
          <input type="submit" name="Submit" value="Submit">
          <input type="reset" name="Submit2" value="Clear">
          <p align="center">&nbsp;</p>
        </form>
...Start Free Trial
 
Loading Advertisement...
 
[+][-]04.18.2006 at 02:19AM PDT, ID: 16476321

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04.18.2006 at 03:59AM PDT, ID: 16476746

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 7-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]04.18.2006 at 04:00AM PDT, ID: 16476751

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.18.2006 at 05:01AM PDT, ID: 16477011

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04.18.2006 at 05:04AM PDT, ID: 16477033

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.18.2006 at 05:05AM PDT, ID: 16477037

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.19.2006 at 03:59AM PDT, ID: 16486169

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04.19.2006 at 04:01AM PDT, ID: 16486184

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04.19.2006 at 04:02AM PDT, ID: 16486188

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.19.2006 at 04:03AM PDT, ID: 16486197

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.19.2006 at 04:04AM PDT, ID: 16486203

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.19.2006 at 04:05AM PDT, ID: 16486205

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.19.2006 at 04:08AM PDT, ID: 16486222

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04.19.2006 at 04:09AM PDT, ID: 16486228

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.19.2006 at 04:10AM PDT, ID: 16486233

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.19.2006 at 04:12AM PDT, ID: 16486240

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.19.2006 at 04:36AM PDT, ID: 16486387

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04.19.2006 at 04:38AM PDT, ID: 16486404

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04.19.2006 at 04:40AM PDT, ID: 16486425

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04.19.2006 at 04:41AM PDT, ID: 16486433

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04.19.2006 at 04:42AM PDT, ID: 16486444

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04.19.2006 at 04:43AM PDT, ID: 16486450

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04.19.2006 at 04:43AM PDT, ID: 16486461

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.19.2006 at 04:44AM PDT, ID: 16486468

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.19.2006 at 04:45AM PDT, ID: 16486476

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.19.2006 at 04:48AM PDT, ID: 16486507

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04.19.2006 at 04:50AM PDT, ID: 16486522

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.19.2006 at 04:52AM PDT, ID: 16486531

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04.19.2006 at 04:56AM PDT, ID: 16486576

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.19.2006 at 04:59AM PDT, ID: 16486585

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.19.2006 at 05:00AM PDT, ID: 16486601

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.19.2006 at 05:01AM PDT, ID: 16486612

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.19.2006 at 05:02AM PDT, ID: 16486619

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.19.2006 at 05:03AM PDT, ID: 16486625

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.19.2006 at 05:03AM PDT, ID: 16486634

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04.19.2006 at 05:05AM PDT, ID: 16486655

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.19.2006 at 05:09AM PDT, ID: 16486696

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04.19.2006 at 05:10AM PDT, ID: 16486705

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.19.2006 at 05:11AM PDT, ID: 16486708

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04.19.2006 at 05:11AM PDT, ID: 16486715

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.19.2006 at 05:13AM PDT, ID: 16486732

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04.19.2006 at 05:14AM PDT, ID: 16486739

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04.19.2006 at 05:14AM PDT, ID: 16486746

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.19.2006 at 05:15AM PDT, ID: 16486753

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.19.2006 at 05:16AM PDT, ID: 16486758

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.19.2006 at 05:17AM PDT, ID: 16486772

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.19.2006 at 05:19AM PDT, ID: 16486787

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.19.2006 at 09:58PM PDT, ID: 16495105

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04.19.2006 at 10:23PM PDT, ID: 16495188

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04.19.2006 at 10:25PM PDT, ID: 16495193

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04.19.2006 at 10:28PM PDT, ID: 16495202

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04.19.2006 at 10:30PM PDT, ID: 16495209

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.