dougaopu7938
2017-05-19 05:24
浏览 75
已采纳

如何在浏览器和页面刷新后点击按钮后重新更新查询

I was set values in session when user on first page when he click the back button session variables also set with it

if(isset($_SESSION['Seats']))
{
    $Eventid = $_SESSION['Eventid'];
    $stmt = $con->prepare(
        'UPDATE fistevent SET `Status`=" " where `Event_Id`=? AND `seats`=? AND `Status`="Hold" '
    );
    $stmt->bind_param(
         "st",$_SESSION['Eventid'],
          $_SESSION['Seats']
    );
    $stmt->execute();
    session_destroy();
    session_unset();
}

these values are came from other page through POST method

if(isset($_POST['EventId']))
        {
        $Price=mysqli_real_escape_string($con,$_POST['Price']);
        $TicketType=mysqli_real_escape_string($con,$_POST['TicketType']);
        $EventId=mysqli_real_escape_string($con,$_POST['EventId']);
        }
        $stmt = $con->prepare("select * from fistevent WHERE  row_name LIKE 'A%'");
        $stmt->bind_param("s", $_POST['EventId']);
        $stmt->execute();
        $result = $stmt->get_result();
        $numRows = $result->num_rows;
        if($numRows > 0) {
        echo '<ul id="sub" class="sub">';
       while($r = $result->fetch_assoc()) {
**displaying vlaues here came from database**

}
        else
        {
            echo "No seats Available";
        }
  • 写回答
  • 好问题 提建议
  • 追加酬金
  • 关注问题
  • 邀请回答

1条回答 默认 最新

相关推荐 更多相似问题