1.The Drop down list- lists the timestamp duration at which the images where put into database
To view a image, user selects the timestamp displayed in the drop down list and clicks submit
As soon as the submit button is pressed, "Connect.php" connects to database, makes "select" query comparing the timestamp in database to the timestamp user as selected
BUT I KEEP GETTING ERROR AS INVALID QUERY: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '19:21:43' at line 1
DATABASE TABLE HAS
1 "time_stamp" -datetime- CURRENT_TIMESTAMP
2 "name" - varchar(200)
3 "images"- longblob
kindly see the code and correct me
index.php
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<?php
$conn=mysql_connect("localhost","root","");
mysql_select_db("simpletest",$conn);
$qry= "select * from indu";
$result=mysql_query($qry,$conn);
$options="";
while($row=mysql_fetch_array($result))
{
$options = $options."<option> $row[0] </option>";
}
?>
</head>
<body>
<form action="connect.php" method="post">
<select name="selected">
<?php echo $options; ?>
</select>
<input type="submit" name="submit" value="submit" />
</form>
</body>
</html>
connect.php
<?php
$connn=mysql_connect("localhost","root","");
mysql_select_db("simpletest",$connn);
if (isset($_POST['submit']))
{
$v1=$_POST['selected'];
echo $v1;
echo "<br/>";
$qrry= "select * from indu where 'time_stamp'=$v1";
echo $qrry;
$result1=mysql_query($qrry,$connn);
echo $result1;
if (!$result1)
{
die('Invalid query: ' . mysql_error());
}
while($row1=mysql_fetch_array($result1))
{
echo '<img height"300" width="300" src="data:image;base64,'.$row1[1].'"/>';
}
}
?>