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 Matlab编程问题
    • ¥15 训练的多模态特征融合模型准确度很低怎么办
    • ¥15 kylin启动报错log4j类冲突
    • ¥15 超声波模块测距控制点灯,灯的闪烁很不稳定,经过调试发现测的距离偏大
    • ¥15 import arcpy出现importing _arcgisscripting 找不到相关程序
    • ¥15 onvif+openssl,vs2022编译openssl64
    • ¥15 iOS 自定义输入法-第三方输入法
    • ¥15 很想要一个很好的答案或提示
    • ¥15 扫描项目中发现AndroidOS.Agent、Android/SmsThief.LI!tr
    • ¥15 怀疑手机被监控,请问怎么解决和防止