php-The first click, the result is: Click after 2, modify 3, after the execution 3

Source: Internet
Author: User
Keywords Php
Php

list.php file

      ">    
   
           

show.php file

 //获取传过来文章ID    $id=$_GET['vid'];    //根据文章ID来得到文章对象    $sqlStr_post="select * from dt_posts where id=".$id;    $result=mysql_query($sqlStr_post);    $view=mysql_fetch_array($result);    //点击前    echo "点击后:".$view['view_count'];    $num=$view['view_count']+1;    //没当用户一点击,就会修改查看次数    $sql_up="update dt_posts set view_count=".$num." where id=".$id;    echo "修改后:".$num;    $result_up=mysql_query($sql_up);    echo "执行后".$num;
  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.