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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T21:21:05+00:00 2026-05-27T21:21:05+00:00

Why? The data is being submitted successfully to the database and yet I get

  • 0

Why? The data is being submitted successfully to the database and yet I get ‘error’ instead of confirming its submission to mysql database? the code is as follows:

  <?
$sql="SELECT firstname FROM Users WHERE role = 'chairperson'";
$result=mysql_query($sql);

$options="";

while ($row=mysql_fetch_array($result)) {

    $id=$row["firstname"];
    $thing=$row["firstname"];
    $options.="<OPTION VALUE=\"$id\">".$thing; 
}
?>

<?
$sql="SELECT firstname FROM Users WHERE role = 'secretary'";
$result=mysql_query($sql);

$secretary="";

while ($row=mysql_fetch_array($result)) {

    $id=$row["firstname"];
    $thing=$row["firstname"];
    $secretary.="<OPTION VALUE=\"$id\">".$thing; 
}
?>

<form action="meetingsinserted.php" method="post">

<table width="0" border="0">
  <tr>
    <td>      <label for="meeting">Title of Meeting: </label>
</td>
    <td><span id="sprytextfield1">
      <input type="text" name="title" id="title" />
      <span class="textfieldRequiredMsg">Give The Meeting A Title</span></span></td>
  </tr>
  <tr>
    <td>      <label for="chairperson">Chairperson:</label>
</td>
    <td><span id="spryselect1">
      <select name="chairperson" id="chairperson">
        <option>Choose Chairperson</option>
        <option value="0"><?=$options?></option>
      </select>
      <span class="selectRequiredMsg">You Must Choose A Chairperson For This Meeting</span></span></td>
  </tr>
  <tr>
    <td>      <label for="secretary">Secretary:</label>
</td>
    <td><span id="spryselect2">
      <select name="secretary" size="1" id="secretary">
              <option>Choose Secretary</option>
         <option value="0"><?=$secretary?></option>
      </select>
      <span class="selectRequiredMsg">You Must Choose A Secretary For This Meeting</span></span></td>
  </tr>
  <tr>
    <td>      <label for="tof">Terms of Ref: </label>
</td>
    <td><span id="sprytextarea1">
      <textarea name="tof" id="tof" cols="35" rows="5"></textarea>
      <span class="textareaRequiredMsg">What Is The Meeting About</span></span></td>
  </tr>
  <tr>
    <td>      <label for="occurances">Occurances:</label>
</td>
    <td><span id="sprytextfield2">
    <input type="text" name="occurances" id="occurances" />
    <span class="textfieldRequiredMsg">How Many Times Will This Occur Every Year</span><span class="textfieldInvalidFormatMsg">Please Enter Numbers Only</span></span></td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td><br /><input name="" type="submit" value="Create Meeting" /></td>
  </tr>
</table>


</form>

meetingsinserted page is as follows:

<?php

$title = $_REQUEST['title'];
$chairperson = $_REQUEST['chairperson'];
$secretary = $_REQUEST['secretary'];
$tof = $_REQUEST['tof'];
$occurances = $_REQUEST['occurances'];

$con = mysql_connect("********","****","**********");
if (!$con)
  {
  die('Could not connect: ' . mysql_error());
  }

mysql_select_db('***', $con);

$sql="INSERT INTO Meetings (title, chairperson, secretary, tof, occurances) VALUES ('$title','$chairperson', '$secretary','$tof','$occurances')";

if (!mysql_query($sql,$con))
  {
      echo '<h1>Meeting Has Been Sent To Chairperson For Approval</h1>';
  }
  else 
  {
  die('Error: ' . mysql_error());
  }
?>

any ideas guys? thanks

  • 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-27T21:21:06+00:00Added an answer on May 27, 2026 at 9:21 pm

    Because you’ve reversed your conditions:

    if (!mysql_query($sql,$con))
      {
          echo '<h1>Meeting Has Been Sent To Chairperson For Approval</h1>';
      }
      else 
      {
      die('Error: ' . mysql_error());
      }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to get at the item that is being data bound, during the
I am trying to display data after being submitted with ajax. The ajax works
I have a form which is being submitted by ajax. Before submission, there's a
I am using jquery datatables to display data from a mysql database. When you
I've got a whole bunch of data being displayed in different Labels, now I'm
I am working on a content management application in which the data being stored
I'm working on creating a grouped table view. The data is being loaded alright,
I have table rows of data in html being filled from a CGI application.
We use ViewState to store data that is being edited by users. However, ViewState
I have a question regarding the some data which is being transfered from one

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.