doumi7861 2018-07-27 14:47
浏览 46

尝试使用其他页面中的特定数据创建单独的html页面

I am currently in the process of creating a baseball-themed website backed by a database. I have a Scores page that displays a league scoreboard for a chosen date by the user: Screenshot of Scores page

I am using retrosheet game logs stored in a sqlite database to make this happen with the following code:

$sql = "SELECT *, v.teamName AS 'Visitor', h.teamName AS 'Home' "
            . "FROM Games2 "
            . "INNER JOIN TeamNames AS v "
            . "ON Games2.vTeam = v.teamID "
            . "INNER JOIN TeamNames AS h "
            . "ON Games2.homeTeam = h.teamID "
            . "WHERE date = $date";
    $result = $conn->query($sql);

    while ($row = $result->fetch(SQLITE3_ASSOC)):
    ?>
    <div class="content">
        <table class="left">
            <tr>
                <th> </th>
                <th>R</th>
                <th>H</th>
                <th>E</th>
                <th rowspan="3"><a href="./BoxScore.php"><input id="box" type="button" value="Box Score"></a></th>
            </tr>
            <tr>
                <td><?php echo $row['Visitor']; ?></td>
                <td><?php echo $row['visitScore']; ?></td>
                <td><?php echo $row['vH']; ?></td>
                <td><?php echo $row['vE']; ?></td>

            </tr>
            <tr>
                <td><?php echo $row['Home']; ?></td>
                <td><?php echo $row['homeScore']; ?></td>
                <td><?php echo $row['hH']; ?></td>
                <td><?php echo $row['hE']; ?></td>
            </tr>

        </table>   
    </div>

Now, where my issue is coming in. I'm trying to have it so when my "Box Score" button is clicked it redirects the user to a unique Box Score page built with the queried data on my Scores page. Could anyone provide some assistance about how I could/should go about doing this?

I was thinking I could store the date and teams in PHP variables and then be able to query again on the new page using those variables to access that specific game possibly?

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 HFSS 中的 H 场图与 MATLAB 中绘制的 B1 场 部分对应不上
    • ¥15 如何在scanpy上做差异基因和通路富集?
    • ¥20 关于#硬件工程#的问题,请各位专家解答!
    • ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
    • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
    • ¥30 截图中的mathematics程序转换成matlab
    • ¥15 动力学代码报错,维度不匹配
    • ¥15 Power query添加列问题
    • ¥50 Kubernetes&Fission&Eleasticsearch
    • ¥15 報錯:Person is not mapped,如何解決?