我的问题是我想从created_at
每年和每月的属性中获取数据库表中的数据.我试过的代码是:
$post= Mjblog::select(DB::raw('YEAR(created_at) year, MONTH(created_at) month'));
$posts_by_y_m = $post->where('created_at',$post)->get();
Run Code Online (Sandbox Code Playgroud) 错误在下面提到: -
ErrorException in Filesystem.php line 81:
file_put_contents(/var/www/html/Training-management-system/storage/framework/views/bcb68ba8b65b7fabca5fe88709fb00b6): failed to open stream: Permission denied
Run Code Online (Sandbox Code Playgroud)
我可以谷歌但不能得到确切的解决方案.所以,如果有人帮我解决,我感激不尽.
我尝试使用图标glyphicon glyphicon-chevron-right来显示我的设计方向但我需要一些比默认大小更薄的.那么如何减少glyphicon glyphicon-chevron-right的默认bootstrap图标的厚度我的代码是: -
<div style="color:#FFF;">
<span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span>
</div>
Run Code Online (Sandbox Code Playgroud) 我正在为我的项目使用HMVC Codeigniter模式.在我的项目中,我需要在表单上设置值,其中输入类型的字段是file.So,我觉得很有帮助我解决这个问题的人.
我的控制器是test.php
<?php
class Test extends Controller{
function __construct(){
parent::__construct();
}
function index(){
redirect('test/form');
}
function form(){
$this->load->library('form_validation');
$this->load->helper('url');
$this->form_validation->set_rules('fname','First Name','required|trim');
$this->form_validation->set_rules('mname','Middle Name','required|trim');
$this->form_validation->set_rules('lname','Last Name','required|trim');
if (empty($_FILES['userfile']['name']))
{
$this->form_validation->set_rules('userfile', 'Attach Your File', 'required');
}
if($this->form_validation->run($this)){
$_SESSION['msg']="Your form has been submitted succesfully!!";
redirect('test/form');
}
else
{
$_SESSION['err']="Opp! There was some wrong to fill up a form so try again!!!";
redirect('test/form');
}
}
$data['pgtitle']='Test';
$this->load->view('test',$data);
}
}
Run Code Online (Sandbox Code Playgroud)
我的视图文件是test.php
<form action="<?php echo site_url()?>test/form" method="post" enctype="multipart/form-data" onsubmit="return confirm('Do you really want to submit …
Run Code Online (Sandbox Code Playgroud) 我正在谷歌搜索并尝试表单nxt两天,它尝试对其进行调试,因此从表中获取数据ID的代码是:
$term=category::get(['id']);
Run Code Online (Sandbox Code Playgroud)
使用该$ varibale按id作为外键从数据库获取数据,其代码如下:-
$categories = HelpCenter::whereHas('category', function($category) use ($term)
{
$category->where('category_id','=',$category);
})
->take(5)->get();
Run Code Online (Sandbox Code Playgroud)