在laravel中的find_in_set子句中使用子查询进行bulid查询

时间:2019-03-20 11:09:10

标签: laravel

我需要在laravel中构建以下内容的帮助

<form action="#" id="form" method="get">
  <input type="text" id="forum-comment" name="forum-comment">
  <input type="submit" name="submit" value="Submit">
</form>

<?php
// Check if form was submitted
$value = array();
if(isset($_GET['submit'])){
  $comment = $_GET['forum-comment'];
  $time = date('d/m/Y g:i a', time());

  global $current_user;
  get_currentuserinfo();

  // Comments
  $id = get_the_id();
  $field_key = "field_5c90d272c7ca9";

  $value[] = array(
    "time"          => $time,
    "posted_by"     => $current_user->ID,
    "comment"           => $comment,
  );

  update_field( $field_key, $value, $id );
}

0 个答案:

没有答案
相关问题