I am trying to figure it out and and I'm stuck at a stand still. I am creating a portal in which phone numbers are stored inside of a table called: fusionnationweb_callrecordings . The table stores an ai, recordingdate, recordingid, caller, receiver, time, and duration. I am trying to create a searchable PHP form in which you enter a phone number in (which is stored in caller and receiver) and you enter a start date and end date. The form will then display a table that shows all entrys for the specified phone number between the start and end date. This is what I have so far; please help!
<form action="" method="post">
Phone Number: <input type="text" name="phonenumber" /><br />
Start Date: <input type="text" name="startdate" /><br />
End Date: <input type="text" name="enddate" /><br />
<input type="submit" value="Submit" />
</form>
<?php
if (!empty($_REQUEST['term'])) {
$term = mysql_real_escape_string($_REQUEST['term']);
$sql = "SELECT * FROM fusionnationweb_callrecordings WHERE `recordingdate` BETWEEN '%".$startdate."%' AND '%".$enddate."%'";
$r_query = mysql_query($sql);
while ($row = mysql_fetch_array($r_query)){
echo 'Table ID: ' .$row['tableid'];
echo '<br /> Recording Date: ' .$row['recordingdate'];
echo '<br /> Recording ID: '.$row['recordingid'];
echo '<br /> Caller: '.$row['caller'];
echo '<br /> Receiver: '.$row['receiver'];
echo '<br /> Time of Call: '.$row['time'];
echo '<br /> Call Duration: '.$row['callduration'];
}
}
?>