duangao8359 2016-08-30 11:04
浏览 40
已采纳

根据当前日期提交表单时,在phpmyadmin数据库中插入周数

I want to upload current week number in the database without showing it anywhere in the site when users submit a form. Although I do want to use the week number later to show "Winners of week XX" (main reason I want it uploaded to database). At this time I have created a form which does not refresh the page when submitted to the database. In phpmyadmin I have created a field called Week with type INT. If needed I can of course change this according to working code suggestions. I have spent the last 2 days searching the web and trying to make this work, but finally I decided to join the community and ask about it here. Any suggestions?

Do tell if anyone need me to specify some code. At this time I'm working with script in the index.html and PHP in a separate file.

Problem solved: $weekNumber = date("W"); worked like a charm.

  • 写回答

2条回答 默认 最新

  • doutan8601 2016-08-30 11:10
    关注

    You can get week number by php function date as below and can insert it in DB as per your requirement.

    $weekNumber = date("W"); 
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 Attention is all you need 的代码运行
  • ¥15 一个服务器已经有一个系统了如果用usb再装一个系统,原来的系统会被覆盖掉吗
  • ¥15 使用esm_msa1_t12_100M_UR50S蛋白质语言模型进行零样本预测时,终端显示出了sequence handled的进度条,但是并不出结果就自动终止回到命令提示行了是怎么回事:
  • ¥15 前置放大电路与功率放大电路相连放大倍数出现问题
  • ¥30 关于<main>标签页面跳转的问题
  • ¥80 部署运行web自动化项目
  • ¥15 腾讯云如何建立同一个项目中物模型之间的联系
  • ¥30 VMware 云桌面水印如何添加
  • ¥15 用ns3仿真出5G核心网网元
  • ¥15 matlab答疑 关于海上风电的爬坡事件检测