如何使用php和mysql搜索存储在日期1和日期2之间的mysql表中的电话号码

如何使用php和mysql搜索存储在日期1和日期2之间的mysql表中的电话号码,php,mysql,Php,Mysql,我正在努力想办法,但我陷入了停滞 我正在创建一个门户,其中电话号码存储在名为:fusionnationweb\u callrecordings的表中 该表存储ai、录制日期、录制id、呼叫者、接收者、时间和持续时间。 我试图创建一个可搜索的PHP表单,在其中输入电话号码(存储在caller和receiver中),然后输入开始日期和结束日期 然后,表单将显示一个表格,其中显示开始日期和结束日期之间指定电话号码的所有条目 这就是我目前所拥有的;请帮忙 <!DOCTYPE html> &l

我正在努力想办法,但我陷入了停滞

我正在创建一个门户,其中电话号码存储在名为:
fusionnationweb\u callrecordings
的表中

该表存储ai、录制日期、录制id、呼叫者、接收者、时间和持续时间。
我试图创建一个可搜索的PHP表单,在其中输入电话号码(存储在caller和receiver中),然后输入开始日期和结束日期

然后,表单将显示一个表格,其中显示开始日期和结束日期之间指定电话号码的所有条目

这就是我目前所拥有的;请帮忙

<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="utf-8" />
        <title></title>
    </head>
    <body>
<form action="search.php?go" method="post">  
                    <style type="text/css">
                        .tg  {border-collapse:collapse;border-spacing:0;border:none;}
                        .tg td{font-family:Arial, sans-serif;font-size:14px;padding:10px 5px;border-style:solid;border-width:0px;overflow:hidden;word-break:normal;}
                        .tg th{font-family:Arial, sans-serif;font-size:14px;font-weight:normal;padding:10px 5px;border-style:solid;border-width:0px;overflow:hidden;word-break:normal;}
                        .tg .tg-yw4l{vertical-align:top}
                        .tg .tg-fefd{color:#000000;vertical-align:top}
                    </style>
    <div align="center">
        <table class="tg">
            <tr>
                <th class="tg-yw4l">Phone Number:<br></th>
                <th class="tg-yw4l"><input type="text" name="phonenumber" /><br /><br></th>
            </tr>
            <tr>
                <td class="tg-yw4l">Start Date:<br></td>
                <td class="tg-yw4l"><input type="text" name="startdate" /><br /><br></td>
            </tr>
            <tr>
                <td class="tg-yw4l">        End Date: <br></td>
                <td class="tg-fefd"><input type="text" name="enddate" /></td>
            </tr>
        </table>            
        <table class="tg"></br>
            <tr><input type="submit" value="Submit" /></tr>
        </table>
    </div>

</form>  
    </body>
</html>

.tg{边框折叠:折叠;边框间距:0;边框:无;}
.tg td{字体系列:Arial,无衬线;字体大小:14px;填充:10px 5px;边框样式:实心;边框宽度:0px;溢出:隐藏;分词:正常;}
.tg th{字体系列:Arial,无衬线;字体大小:14px;字体重量:正常;填充:10px 5px;边框样式:实心;边框宽度:0px;溢出:隐藏;分词:正常;}
.tg.tg-yw4l{垂直对齐:顶部}
.tg.tg fefd{color:#000000;垂直对齐:top}
电话号码:


开始日期:


结束日期:

以上是主要代码 下面是search.php

<?php
$db_hostname = 'removed';
$db_username = 'removed';
$db_password = 'removed';
$db_database = 'removed';

// Database Connection String
$con = mysql_connect($db_hostname,$db_username,$db_password);
if (!$con)
  {
  die('Could not connect - please consult your database administrator: ' . mysql_error());
  }

mysql_select_db($db_database, $con);
if (!empty($_REQUEST['term'])) {

$term = mysql_real_escape_string($_REQUEST['term']);     

$sql = "SELECT * FROM fusionnationweb_callrecordings WHERE `recordingdate` BETWEEN '%".$startdate."%' AND '%".$enddate."%'"; 
$result = mysql_query($sql); 

        while ($row = mysql_fetch_array($result)){  
                $tableid=$row['Table ID'];  
                $recordingdate=$row['Recording Date'];  
                $recordingid=$row['Recording ID'];  
                $caller=$row['Caller'];  
                $receiver=$row['Receiver'];
                $time=$row['Time of Call'];  
                $callduration=$row['Call Duration']; 
        }  

        }
        ?>


你有什么特别的错误吗?一点都没有。你想测试一下吗?屏幕是空白的,我无法测试你的代码,因为我不在我的系统附近,但是当你运行代码时,你是否看到任何错误或任何类型的异常代码在一个实时网站上。不,在提交表单后,它会将我带到search.php,整个屏幕是空白的。在你的search.php上,你能打印出你从第一页获得的参数,例如开始日期、结束日期吗?你有什么具体的错误吗?一点都没有。你想测试一下吗?屏幕是空白的,我无法测试你的代码,因为我不在我的系统附近,但是当你运行代码时,你是否看到任何错误或任何类型的异常代码在一个实时网站上。不,在提交表单后,它会将我带到search.php,整个屏幕是空白的。在您的search.php上,您可以打印出从第一页获得的参数,例如开始日期、结束日期吗