When i select a particular date from the calendar can the data stored in database be displayed in the form?

<html>
<head>
<body><br>

date:<input type="date" value=" ">
<?php
$dbhost = '';
$dbuser = '';
$dbpass = '';
$conn = mysql_connect($dbhost, $dbuser, $dbpass);
$date = date(" Y-m-d"); 
echo "$date <br>";

if(! $conn )
{
  die('Could not connect: ' . mysql_error());
}
$sql = 'SELECT `date`,`Comments` FROM `details`WHERE `Comments`="malware"  '  ;


mysql_select_db('information');
$retval = mysql_query( $sql, $conn );
if(! $retval )
{
  die('Could not get data: ' . mysql_error());
}
while($row = mysql_fetch_array($retval, MYSQL_NUM))
{
    echo  "comments: {$row[1]} <br> ".
       "date {$row[0]} <br>".
         "--------------------------------<br>";
}
mysql_free_result($retval);
echo "Fetched data successfully\n";
mysql_close($conn);
?>
</boddy>
</html>

Yes. Either you’ve got to submit the form to get the information, or use Ajax to retrieve and insert it into the form without a submit.

You need to look at using PDO instead of the old mysql calls to access the database, as they’re no longer part of the language.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.