hi everyone i have a search page that will search base one date... but if i search with only date (9/27/2011 ) it will only display the data from database
that has the same date and time but not the whole data in that specific date:
example: in my database i have a data:
cow and has a date and time 9/27/2011 12:00:00 AM
carabao and has a date and time 9/27/2011 12:00:00 AM
chicken and has a date and time 9/27/2011 12:01:00 AM
dog and has a date and time 9/27/2011 12:02:00 AM
but when i search: (9/27/2011 )
it will only display data that has the same time
cow that has 9/27/2011 12:00:00 AM
carabao that has 9/27/2011 12:00:00 AM
......how do i make it all display even they have different time..
this is my code btw:
<?php
$conn=odbc_connect('datasourcegaby','','');
$search=mysql_escape_string($_POST['SEARCH']);
if (!$conn)
{exit("Connection Failed: " . $conn);}
$sql="SELECT GEN1MW,GEN1PF FROM generators where TIMESTOMPX= '$search'";
$rs=odbc_exec($conn,$sql);
if (!$rs)
{exit("Error in SQL");}
echo "<div class=\"totalx\"><table border=\"1\" style=\"table-layout:fixed\" class=\"totalinsidet\"><tr class=\"topbth\">";
echo "<th>TOTAL MW</th>";
echo "<th>TOTAL Mvar</th></tr>";
while (odbc_fetch_row($rs))
{
$totalmw=odbc_result($rs,"GEN1MW");
$totalmvar=odbc_result($rs,"GEN1PF");
echo "<tr><td style=\"white-space:pre-wrap;white-space:-moz-pre-wrap;white-space:-pre-wrap;white-space:-o-pre-wrap;word-wrap:break-word\">$totalmw</td>";
echo "<td style=\"white-space:pre-wrap;white-space:-moz-pre-wrap;white-space:-pre-wrap;white-space:-o-pre-wrap;word-wrap:break-word\">$totalmvar</td></tr></div>";
}
echo "</table>";
?>