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 执行 virtuoso 命令后,界面没有,cadence 启动不起来
    • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
    • ¥20 有关区间dp的问题求解
    • ¥15 多电路系统共用电源的串扰问题
    • ¥15 slam rangenet++配置
    • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
    • ¥15 ubuntu子系统密码忘记
    • ¥15 保护模式-系统加载-段寄存器
    • ¥15 电脑桌面设定一个区域禁止鼠标操作
    • ¥15 求NPF226060磁芯的详细资料