hi ,
i got an error.pls help me to correct.
my code is
<form action="return.php" method="post">
<table width="200" border="0">
<tr>
<td><h3 align="center">RETURN</h3></td>
</tr>
</table>
<p align="center"> </p>
<table width="41%" height="254" border="0">
<tbody>
<tr>
<td width="34%">Author:</td>
<td width="66%"><p>
<input type="text" name="author1" />
</p></td>
</tr>
<tr>
<td>Title:</td>
<td><p>
<input type="text" name="title1" />
</p></td>
</tr>
<tr>
<td>Accession No:</td>
<td><p>
<input type="text" name="accessno1" />
</p></td>
</tr>
<tr>
<td>Name:</td>
<td><p>
<input type="text" name="name1" />
</p></td>
</tr>
<tr>
<td>Register No:</td>
<td><p>
<input type="text" name="regno1" />
</p></td>
</tr>
<tr>
<td>Issue Date:</td>
<td><p>
<label for="select"></label>
<select name="sdate1" id="select">
<option>date</option>
<option>1</option>
<option>2</option>
<option>3</option>
<option>4</option>
<option>5</option>
<option>6</option>
<option>7</option>
<option>8</option>
<option>9</option>
<option>10</option>
<option>11</option>
<option>12</option>
<option>13</option>
<option>14</option>
<option>15</option>
<option>16</option>
<option>17</option>
<option>18</option>
<option>19</option>
<option>20</option>
<option>21</option>
<option>22</option>
<option>23</option>
<option>24</option>
<option>25</option>
<option>26</option>
<option>27</option>
<option>28</option>
<option>29</option>
<option>30</option>
<option>31</option>
</select>
<label for="select2"></label>
<select name="sdate1" id="select2">
<option>month</option>
<option>1</option>
<option>2</option>
<option>3</option>
<option>4</option>
<option>5</option>
<option>6</option>
<option>7</option>
<option>8</option>
<option>9</option>
<option>10</option>
<option>11</option>
<option>12</option>
</select>
<label for="select3"></label>
<select name="sdate1" id="select3">
<option>year</option>
<option>2007</option>
<option>2008</option>
<option>2009</option>
<option>2010</option>
<option>2011</option>
<option>2012</option>
<option>2013</option>
<option>2014</option>
<option>2015</option>
<option>2016</option>
</select>
</p></td>
</tr>
<tr>
<td height="34">Due Date:</td>
<td><p>
<select name="ddate1" id="select4">
<option>date</option>
<option>1</option>
<option>2</option>
<option>3</option>
<option>4</option>
<option>5</option>
<option>6</option>
<option>7</option>
<option>8</option>
<option>9</option>
<option>10</option>
<option>11</option>
<option>12</option>
<option>13</option>
<option>14</option>
<option>15</option>
<option>16</option>
<option>17</option>
<option>18</option>
<option>19</option>
<option>20</option>
<option>21</option>
<option>22</option>
<option>23</option>
<option>24</option>
<option>25</option>
<option>26</option>
<option>27</option>
<option>28</option>
<option>29</option>
<option>30</option>
<option>31</option>
</select>
<label for="select5"></label>
<select name="ddate1" id="select5">
<option>month</option>
<option>1</option>
<option>2</option>
<option>3</option>
<option>4</option>
<option>5</option>
<option>6</option>
<option>7</option>
<option>8</option>
<option>9</option>
<option>10</option>
<option>11</option>
<option>12</option>
</select>
<label for="select6"></label>
<select name="ddate1" id="select6">
<option>year</option>
<option>2007</option>
<option>2008</option>
<option>2009</option>
<option>2010</option>
<option>2011</option>
<option>2012</option>
<option>2013</option>
<option>2014</option>
<option>2015</option>
<option>2016</option>
</select>
</p></td>
</tr>
</tbody>
</table>
<p> </p>
<table width="200" border="0">
<tr>
<td>
<div align="center">
<input type="submit" name="button2" id="button2" value="Return" />
<input type="reset" name="Reset" id="button" value="Clear" />
<input name="bk" value="Back" onClick="javascript:window.history.go(-1)" type="button">
</div>
<div align="center"></div>
</td>
</tr>
</table>
</td>
</form>
my php code is
<?php
$author1 = $_POST['author1'];
$title1 = $_POST['title1'];
$accessno1=$_POST['accessno1'];
$name1=$_POST['name1'];
$regno1=$_POST['regno1'];
$sdate1=$_POST['sdate1'];
$ddate1=$_POST['ddate1'];
$con = mysql_connect("localhost");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("test", $con);
$rs=mysql_query("select * from issue where title='$title1'");
$count=mysql_num_rows($rs);
if($count>0)
{
$sql="INSERT INTO return (author1,title1,accessno1,name1,regno1,sdate1,ddate1) VALUES('$author1','$title1','$accessno1','$name1','$regno1','$sdate1','$ddate1')";
mysql_query($sql) or die(mysql_error());
echo "<script ='javascript'type='text/javascript'>
alert('book returned')
</script>";
}
mysql_close($con)
?>
also i have a problem in date in the database..it is displayin like 00-00-0000..how can i recover from this problem