inserting datas through table

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Dear Sir/Madam,
    I have created  reservation table i need to store all the values in
database when i click the submit button
but it couldn`t working.
/*
Master3.php
*/
<HTML>
<?php
if($submit)
{
$db = mysql_connect("localhost", "kumar","");
mysql_select_db("Golf",$db);
$sql = "INSERT INTO reservationmst(udate,timezone,starttime) VALUES
('$udate','$timezone','$starttime')";
$result = mysql_query($sql);
echo "Thank you! Information entered.\n";
}
else
{
?>
<form method="get" action="Master3.php">
<table border="2">
<tr>
<tr>
 <th>Month </th>
 <th>Day</th>
 <th>Time Zone</th>
  <th>Start Time</th>
<th>Department</th>
</tr>
<tr>
  <td ><input type="text" size="10" name="udate" ></td>
<td>
<SELECT NAME="youbi">
<?php $db = mysql_connect("localhost", "kumar")
OR DIE("Unable to connect to database");
mysql_select_db("Golf",$db);
$result = mysql_query("SELECT youbi FROM reservationmst",$db);
 echo("<option value=\"\">select </option>");
while($myrow = mysql_fetch_array($result))
 {
    printf("<option value=\"%s\">%s</option>\n",
$myrow["youbi"],$myrow["youbi"]);
 }
?></SELECT></td>
  <td><input type="text" size="10" name="timezone"></td>
  <td><input type="text" size="10" name="starttime"></td>
<td>
<SELECT NAME="bumon">
<?php $db = mysql_connect("localhost", "kumar")
OR DIE("Unable to connect to database");
mysql_select_db("Golf",$db);
$result = mysql_query("SELECT bumon FROM personalmst",$db);
 echo("<option value=\"\">select </option>");
while($myrow = mysql_fetch_array($result))
 {
    printf("<option value=\"%s\">%s</option>\n",
$myrow["bumon"],$myrow["bumon"]);
 }
?></SELECT>
<SELECT NAME="bumon">
<?php $db = mysql_connect("localhost", "kumar")
OR DIE("Unable to connect to database");
mysql_select_db("Golf",$db);
$result = mysql_query("SELECT bumon FROM personalmst",$db);
 echo("<option value=\"\">select </option>");
while($myrow = mysql_fetch_array($result))
 {
    printf("<option value=\"%s\">%s</option>\n",
$myrow["bumon"],$myrow["bumon"]);
 }
?></SELECT>
<SELECT NAME="bumon">
<?php $db = mysql_connect("localhost", "kumar")
OR DIE("Unable to connect to database");
mysql_select_db("Golf",$db);
$result = mysql_query("SELECT bumon FROM personalmst",$db);
 echo("<option value=\"\">select </option>");
while($myrow = mysql_fetch_array($result))
 {
    printf("<option value=\"%s\">%s</option>\n",
$myrow["bumon"],$myrow["bumon"]);
 }
?></SELECT>
<SELECT NAME="bumon">
<?php $db = mysql_connect("localhost", "kumar")
OR DIE("Unable to connect to database");
mysql_select_db("Golf",$db);
$result = mysql_query("SELECT bumon FROM personalmst",$db);
 echo("<option value=\"\">select </option>");
while($myrow = mysql_fetch_array($result))
 {
    printf("<option value=\"%s\">%s</option>\n",
$myrow["bumon"],$myrow["bumon"]);
 }
?></SELECT>
</td>
</tr>
<tr>
  <td ><input type="text" size="10" name="udate" ></td>
<td>
<SELECT NAME="youbi">
<?php $db = mysql_connect("localhost", "kumar")
OR DIE("Unable to connect to database");
mysql_select_db("Golf",$db);
$result = mysql_query("SELECT youbi FROM reservationmst",$db);
 echo("<option value=\"\">select </option>");
while($myrow = mysql_fetch_array($result))
 {
    printf("<option value=\"%s\">%s</option>\n",
$myrow["youbi"],$myrow["youbi"]);
 }
?></SELECT></td>
  <td><input type="text" size="10" name="timezone"></td>
  <td><input type="text" size="10" name="starttime"></td>
<td>
<SELECT NAME="bumon">
<?php $db = mysql_connect("localhost", "kumar")
OR DIE("Unable to connect to database");
mysql_select_db("Golf",$db);
$result = mysql_query("SELECT bumon FROM personalmst",$db);
 echo("<option value=\"\">select </option>");
while($myrow = mysql_fetch_array($result))
 {
    printf("<option value=\"%s\">%s</option>\n",
$myrow["bumon"],$myrow["bumon"]);
 }
?></SELECT>
<SELECT NAME="bumon">
<?php $db = mysql_connect("localhost", "kumar")
OR DIE("Unable to connect to database");
mysql_select_db("Golf",$db);
$result = mysql_query("SELECT bumon FROM personalmst",$db);
 echo("<option value=\"\">select </option>");
while($myrow = mysql_fetch_array($result))
 {
    printf("<option value=\"%s\">%s</option>\n",
$myrow["bumon"],$myrow["bumon"]);
 }
?></SELECT>
<SELECT NAME="bumon">
<?php $db = mysql_connect("localhost", "kumar")
OR DIE("Unable to connect to database");
mysql_select_db("Golf",$db);
$result = mysql_query("SELECT bumon FROM personalmst",$db);
 echo("<option value=\"\">select </option>");
while($myrow = mysql_fetch_array($result))
 {
    printf("<option value=\"%s\">%s</option>\n",
$myrow["bumon"],$myrow["bumon"]);
 }
?></SELECT>
<SELECT NAME="bumon">
<?php $db = mysql_connect("localhost", "kumar")
OR DIE("Unable to connect to database");
mysql_select_db("Golf",$db);
$result = mysql_query("SELECT bumon FROM personalmst",$db);
 echo("<option value=\"\">select </option>");
while($myrow = mysql_fetch_array($result))
 {
    printf("<option value=\"%s\">%s</option>\n",
$myrow["bumon"],$myrow["bumon"]);
 }
?></SELECT>
</td>
</tr>
<tr>
  <td ><input type="text" size="10" name="udate" ></td>
<td>
<SELECT NAME="youbi">
<?php $db = mysql_connect("localhost", "kumar")
OR DIE("Unable to connect to database");
mysql_select_db("Golf",$db);
$result = mysql_query("SELECT youbi FROM reservationmst",$db);
 echo("<option value=\"\">select </option>");
while($myrow = mysql_fetch_array($result))
 {
    printf("<option value=\"%s\">%s</option>\n",
$myrow["youbi"],$myrow["youbi"]);
 }
?></SELECT></td>
  <td><input type="text" size="10" name="timezone"></td>
  <td><input type="text" size="10" name="starttime"></td>
<td>
<SELECT NAME="bumon">
<?php $db = mysql_connect("localhost", "kumar")
OR DIE("Unable to connect to database");
mysql_select_db("Golf",$db);
$result = mysql_query("SELECT bumon FROM personalmst",$db);
 echo("<option value=\"\">select </option>");
while($myrow = mysql_fetch_array($result))
 {
    printf("<option value=\"%s\">%s</option>\n",
$myrow["bumon"],$myrow["bumon"]);
 }
?></SELECT>
<SELECT NAME="bumon">
<?php $db = mysql_connect("localhost", "kumar")
OR DIE("Unable to connect to database");
mysql_select_db("Golf",$db);
$result = mysql_query("SELECT bumon FROM personalmst",$db);
 echo("<option value=\"\">select </option>");
while($myrow = mysql_fetch_array($result))
 {
    printf("<option value=\"%s\">%s</option>\n",
$myrow["bumon"],$myrow["bumon"]);
 }
?></SELECT>
<SELECT NAME="bumon">
<?php $db = mysql_connect("localhost", "kumar")
OR DIE("Unable to connect to database");
mysql_select_db("Golf",$db);
$result = mysql_query("SELECT bumon FROM personalmst",$db);
 echo("<option value=\"\">select </option>");
while($myrow = mysql_fetch_array($result))
 {
    printf("<option value=\"%s\">%s</option>\n",
$myrow["bumon"],$myrow["bumon"]);
 }
?></SELECT>
<SELECT NAME="bumon">
<?php $db = mysql_connect("localhost", "kumar")
OR DIE("Unable to connect to database");
mysql_select_db("Golf",$db);
$result = mysql_query("SELECT bumon FROM personalmst",$db);
 echo("<option value=\"\">select </option>");
while($myrow = mysql_fetch_array($result))
 {
    printf("<option value=\"%s\">%s</option>\n",
$myrow["bumon"],$myrow["bumon"]);
 }
?></SELECT>
</td>
</tr>
</table>
</tr>
<input type="Submit"name="submit" value="Touroku"><br>
</form>
<?
}
?>
</HTML>

[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux