dongzang7182 2010-10-14 08:21
浏览 31

vBulletin - 从用户表中提取用户名

I need to extract a list of all usernames from the user table in vBulletin of persons who were registered up to a certain date. So for example, I need all members up until 1st Oct, but after that is not required.

The 'joindate' field is expressed in seconds I think. Eg. 1116022743. How can I can extract usernames on this basis?

cheers

  • 写回答

2条回答 默认 最新

  • doujiayuan8415 2010-10-14 08:38
    关注

    Hard to give you an exact answer without knowing the VB table structure, but the query would be something like

    $date = strtotime('10/01/2010'); 
    /* this is the date you are basing our query on
    we make a timestamp of it for comparison */
    
    $sql = "SELECT * FROM `vb_users_table` WHERE `joindate` <= '$date'";
    

    those "seconds" are timestamps btw (technically seconds, but the correct term is timestamp).

    example:

    <?php
    
    $date = strtotime('10/01/2010'); //1st oct 2010
    $old = strtotime('3/9/2009'); // 9th mar 2009
    $new = strtotime('3/9/2011') // 9th mar 2011
    
    /* substitute $old with $new to see the effect */
    if($old<=$date) { 
        echo date('d M Y', $old) . ' is before ' . date('d M Y', $date);
    } else {
        echo date('d M Y', $old) . ' is not before ' . date('d M Y', $date);
    }
    
    评论

报告相同问题?

悬赏问题

  • ¥15 这个主板怎么能扩出一两个sata口
  • ¥15 不是,这到底错哪儿了😭
  • ¥15 2020长安杯与连接网探
  • ¥15 关于#matlab#的问题:在模糊控制器中选出线路信息,在simulink中根据线路信息生成速度时间目标曲线(初速度为20m/s,15秒后减为0的速度时间图像)我想问线路信息是什么
  • ¥15 banner广告展示设置多少时间不怎么会消耗用户价值
  • ¥16 mybatis的代理对象无法通过@Autowired装填
  • ¥15 可见光定位matlab仿真
  • ¥15 arduino 四自由度机械臂
  • ¥15 wordpress 产品图片 GIF 没法显示
  • ¥15 求三国群英传pl国战时间的修改方法