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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T22:39:56+00:00 2026-05-13T22:39:56+00:00

when i submit the form.. the form display the ‘error’ msg that mean the

  • 0

when i submit the form..
the form display the ‘error’ msg that mean the query does’nt work..
i’ve compare the code with the other code and it seem similar…
i dont know what to do with this..
please guys…
help me…

(here’s is the form code)

<?php
if(isset($_GET['bookno']))
        $bookingno = $_GET['bookno'];
    elseif(isset($_POST['bookno']))
        $bookingno = $_POST['bookno'];
    else
        $bookingno = "";

    $db = mysql_connect('localhost','root') 
    or die ("unable to connect");
    mysql_select_db('fyp',$db) or die ("able to select");

$sql_select = "SELECT * FROM `booking` "
                    . " WHERE `bookingno`='".trim($bookingno)."'";

     $result = mysql_query($sql_select) or die ("Query failed!");
     $row = mysql_fetch_array($result);
     extract($row);

 ?>
    <form method ="post" action="appbooking.php">
<font face= "arial" size="2" font color="black">
<center>
<table width="800" height="150" border="0" cellspacing="0" cellpadding="2">
  <tr>
  <tr>
    <td height="28" colspan="8" valign="middle" bgcolor="#0A25E9"><center>
      <font color="white" size="3" face="Times New Roman" font="font"><b>BOOKING DETAIL</b></font>
    </center>
    </tr>
  <tr>
    <td width="129" align="left" ><font face="Arial" size="2" font color="#000000">Booking No</font></td>
    <td width="291"><input name="bookingno" type="text" value= "<?php echo $row['bookingno']; ?>" size="30" ></td>
    <td width="94" align="left" ><font face="Arial" size="2" font color="#000000">User ID</font></td>
    <td width="270"><input name="username" type="text" id="username" value= "<?php echo $row['username']; ?>" size="30" ></td>
  </tr>
  <tr>
    <td width="129" align="left"><font face="Arial" size="2" font color="#000000"> Name</font></td>
    <td width="291"><input name="name" type="text" id="name" value= "<?php echo $row['name']; ?>"size="45" ></td>
    <td width="94" align="left"><font face="Arial" size="2" font color="#000000">Department</font></td>
    <td><input name="department" type="text" id="department" value= "<?php echo $row['department']; ?>" size="45" >
    </tr>
  <tr>
    <td width="129" align="left" ><font face="Arial" size="2" font color="#000000">Required Date</font></td>
    <td width="291"><input name="u_g_date" type="text" id="g_date" value= "<?php echo $row['g_date']; ?>" size="30" ></td>
    <td width="94" align="left" ><font face="Arial" size="2" font color="#000000">Required Time</font></td>
    <td><input name="g_time" type="text" id="g_time" value= "<?php echo $row['g_time']; ?>" size="30" ></td>
  </tr>
  <tr>
    <td width="129" align="left" ><font face="Arial" size="2" font color="#000000">Return Date</font></td>
    <td width="291"><input name="u_r_date" type="text" id="r_date" value= "<?php echo $row['r_date']; ?>" size="30" ></td>
    <td width="94" align="left" ><font face="Arial" size="2" font color="#000000">Return Time</font></td>
    <td><input name="r_time" type="text" id="r_time" value= "<?php echo $row['r_time']; ?>" size="30" ></td>
  </tr>
  <tr>
    <td width="129" align="left"><font face="Arial" size="2" font color="#000000">Destination</font></td>
    <td width="291"><input name="u_destination" type="text" id="destination" value= "<?php echo $row['destination']; ?>" size="45" ></td>
    <td width="94" align="left"><font face="Arial" size="2" font color="#000000">Num Of Passengger</font></td>
    <td><input name="pass_num" type="text" id="pass_num" value= "<?php echo $row['pass_num']; ?>" ></td>
  </tr>
  <tr>
    <td width="129" align="left"><font face="Arial" size="2" font color="#000000">Purpose Of Trip</font></td>
    <td width="291"><textarea name="trip_purpose" rows="3" cols="40 " >
           <?php echo $row['trip_purpose']; ?>
           </textarea></td>
  </tr>
  <p>&nbsp;</p>
  <td><p>&nbsp;</p>
  <tr>
   <tr>
        <td height="28" colspan="8" valign="middle" bgcolor="#0A25E9">
        &nbsp;  &nbsp;  &nbsp;  &nbsp; &nbsp;   &nbsp;  &nbsp;  &nbsp;&nbsp;    &nbsp;  &nbsp;  &nbsp; &nbsp;   &nbsp;  &nbsp;  &nbsp; &nbsp; &nbsp;    &nbsp;  &nbsp;  &nbsp;&nbsp;    &nbsp;  &nbsp; &nbsp; &nbsp;    

        <font color="white" size="3" face="Times New Roman"     font="font"><b>APPROVE</b></font>
        &nbsp;  &nbsp;  &nbsp;  &nbsp; &nbsp;   &nbsp;  &nbsp;  &nbsp;&nbsp;    &nbsp;  &nbsp;  &nbsp; &nbsp;   &nbsp;  &nbsp;  &nbsp;&nbsp;&nbsp;  &nbsp;  &nbsp;  &nbsp; &nbsp;   &nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp; &nbsp;   &nbsp;  &nbsp;  &nbsp;&nbsp;    &nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp; &nbsp;   &nbsp;  &nbsp;  &nbsp;


        <font color="white" size="3" face="Times New Roman"     font="font"><b>REJECT</b></font>
</td>

  </tr>
  <p>&nbsp;</p>
  <?php
     $db = mysql_connect('localhost','root') 
     or die ("unable to connect");
    mysql_select_db('fyp',$db) or die ("able to select");

    $sql="SELECT * FROM vehicle WHERE v_status='READY'";

     $result = mysql_query($sql) or die ("Query failed!");  
 ?>
  <tr>
  <tr>
    <td>Registration Number 
    <td><select name="regno">
            <option value="" selected>--Registration No--</option>
            <?php while($row = mysql_fetch_array($result)){?>
            <option value="<?php echo $row['regno']; ?>"><?php echo $row['regno']; ?></option>
            <?php } ?>
        </select></td>
    <td>Reason</td>
  <td><textarea name="reason" rows="3" cols="50 "value = ""></textarea></td>
  </tr>
  <?php
     $db = mysql_connect('localhost','root') 
     or die ("unable to connect");
    mysql_select_db('fyp',$db) or die ("able to select");

    $sql="SELECT * FROM driver WHERE d_status='READY'";

     $result = mysql_query($sql) or die ("Query failed!");  
 ?>
  <tr>
    <td>Driver</td>
    <td><select id = "d_name" name="u_d_name">
      <option value="" selected>--Driver Name--</option>
      <?php while($row = mysql_fetch_array($result)){?>
      <option value="<?php echo $row['d_name']; ?>"><?php echo $row['d_name']; ?></option>
      <?php } ?>
    </select></td>
  </tr>
  <tr>
<?php                    
      mysql_close($db);
?>

</table>

(here's the code for the addprocessor)
<?php
   $db = mysql_connect('localhost','root') 
     or die ("unable to connect");
     mysql_select_db('fyp',$db)
     or die ("able to select");

    $bookingno=$_POST['bookingno'];
    $username=$_POST['username'];
    $name=$_POST['name'];
    $department=$_POST['department'];
    $g_date=$_POST['g_date'];
    $r_date=$_POST['r_date'];
    $r_time=$_POST['r_time'];
    $destination=$_POST['destination'];
    $pass_num=$_POST['pass_num'];
    $trip_purpose=$_POST['trip_purpose'];
    $regno=$_POST['regno'];
    $d_name=$_POST['d_name'];
    $reason=$_POST['reason'];


$sql = "INSERT INTO usage VALUES('$bookingno','$username','$name','$department', '$g_date', '$g_time', '$r_date', '$r_time', '$destination', '$pass_num', '$trip_purpose', '$regno', '$d_name', '$reason')";

$result = mysql_query($sql) or die ("error!");
//$result = mysql_query($sql) or die ($query);

echo "<font face = arial size= 3><b>Booking No : </b>".$bookingno."</font>"."<br>";  
echo "<font face = arial size= 3><b>Applicant's ID : </b>".$username."</font>"."<br>";
echo "<font face = arial size= 3><b>Applicant's Name : </b>".$name."</font>"."<br>";
echo "<font face = arial size= 3><b>Department : </b>".$department."</font>"."<br>";
echo "<font face = arial size= 3><b>Required Date : </b>".$g_date."</font>"."<br>";
echo "<font face = arial size= 3><b>Required Time: </b>".$g_time."</font>"."<br>";
echo "<font face = arial size= 3><b>Return Date : </b>".$r_date."</font>"."<br>";
echo "<font face = arial size= 3><b>Return Time : </b>".$r_time."</font>"."<br>";
echo "<font face = arial size= 3><b>Destinantion : </b>".$destination."</font>"."<br>";
echo "<font face = arial size= 3><b>Number Of Passenger : </b>".$pass_num."</font>"."<br>";
echo "<font face = arial size= 3><b>Trip Purpose : </b>".$trip_purpose."</font>"."<br>";
echo "<font face = arial size= 3><b>Registration Number : </b>".$regno."</font>"."<br>";
echo "<font face = arial size= 3><b>Driver Name : </b>".$d_name."</font>"."<br>";
echo "<font face = arial size= 3><b>Reject Reason : </b>".$reason."</font>"."<br>";


mysql_close($db);

echo "<font face = arial size= 4>You have sucessfully record booking details to the database.</font>";  

?>
  • 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-13T22:39:57+00:00Added an answer on May 13, 2026 at 10:39 pm
    $bookingno=mysql_real_escape_string($_POST['bookingno']);
    

    and so on

    Note that

    $result = mysql_query($sql) or trigger_error (mysql_error().' in '.$sql); 
    

    call would be much more informative in case of error

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

Sidebar

Ask A Question

Stats

  • Questions 354k
  • Answers 354k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer EDIT: Seems that the network diagram is over simplified and… May 14, 2026 at 8:29 am
  • Editorial Team
    Editorial Team added an answer If node is your user node: node.Elements("Adress").OrderBy(e=>e.Attribute("Name").Value) May 14, 2026 at 8:29 am
  • Editorial Team
    Editorial Team added an answer Try doing this with javascript to enable and disable validators… May 14, 2026 at 8:29 am

Related Questions

I'm running into a bit of an issue when I try to return a
I've got a really simple rails question here but I can't seem to find
I'm kind of new to this so please bear with me... Let's say I
I have 4 JSP pages index.jsp - default index webpage. Index.jsp includes the build.jsp
I have a form, when user submit the form, I want to direct the

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.