小编Sto*_*rit的帖子

此扩展需要SQL Server的Microsoft ODBC驱动程序11与SQL Server进行通信

已经在microsoft上下载了sqlsrv ...

在此输入图像描述

和我的phpinfo()

在此输入图像描述

在此输入图像描述

启用了php.ini两个C:\wamp\bin\apache\apache2.4.9\binC:\wamp\bin\php\php5.5.12 在此输入图像描述

仍然有这样的错误.

Failed to get DB handle: SQLSTATE[IMSSP]: This extension requires the Microsoft ODBC Driver 11 for SQL Server to communicate with SQL Server. Access the following URL to download the ODBC Driver 11 for SQL Server for x86: http://go.microsoft.com/fwlink/?LinkId=163712 
Run Code Online (Sandbox Code Playgroud)

我的代码是

try {
    $dbh = new PDO ("sqlsrv:Server=$host;Database=$db","$user","$pass");
  } catch (PDOException $e) {
    echo "Failed to get DB handle: " . $e->getMessage() . "\n";
    exit;
  }
  $stmt = $dbh->prepare("select top 5 from …
Run Code Online (Sandbox Code Playgroud)

php sql-server

25
推荐指数
1
解决办法
4万
查看次数

如何在服务上使用SnackBar在Angular 2中的每个组件中使用

我有一个工作的零食吧,但它只在每个组件上,我想在我的服务上添加它,所以我会打电话给它.这是我的样本component.ts

import { MdSnackBar, MdSnackBarRef } from '@angular/material';
...
export class EmployeeListComponent implements OnInit {
  public toastRef: MdSnackBarRef<any>;
  constructor(private _activatedRoute:ActivatedRoute,private router: Router, private http:PMISHttpService, private toast: MdSnackBar) {

  ngOnInit() {
    this.notify('test');
  }
  ...
  notify (text: string) {
    this.toastRef = this.toast.open(text, null);
    setTimeout(() => {
      this.toastRef.dismiss();
    }, 5000);
  }
  ...
}
Run Code Online (Sandbox Code Playgroud)

snackbar angular-material2 angular

12
推荐指数
4
解决办法
9355
查看次数

如何在Angular 2上没有FormBuilder的情况下推送FormArray

我有表格阵列,我很难解决这个问题.

这是我目前的代码

.TS

ngOnInit() {
    this.item = this.fb.group({
      codeId: ['', Validators.pattern(/^\d+$/)],
      name: ['', [Validators.required, Validators.minLength(3)]],
      stepTextarea: ['', []],
      steps: [this.fb.array([]), []]
    });
}
addProcedure (e): void {
    e.preventDefault();
    const control = <FormGroup>this.item;
    const steps = <FormArray>this.item.controls['steps'];

    steps.push(control.get('stepTextarea').value);
    control.get('stepTextarea').setValue("", {onlySelf: true})
  }

onSubmit({value, valid}: {value: Item, valid: boolean}): void {
    const control = <FormGroup>this.item;
    console.log(value);
}
Run Code Online (Sandbox Code Playgroud)

html的

<ol ngFor [ngForOf]="item.get('steps').controls">
  <span [formGroupName]="i">{{i}}</span>
</ol>
Run Code Online (Sandbox Code Playgroud)

我很难如何填充和推动.我找不到任何教程.

编辑

提交时我想要这样的东西

{
    codeId: 123,
    name: "wew",
    stepTextarea: "",
    steps: ['asdjlkas','12312','12321']
}
Run Code Online (Sandbox Code Playgroud)

typescript angular

10
推荐指数
1
解决办法
1万
查看次数

Laravel5 - 非静态方法不应静态调用

我不知道这个错误是什么。请有人给我一些解释

在我的UserController.php

class UserController extends Controller {
    public function viewCard($card_id) {
        return Tag::test($card_id);
    }
}
Run Code Online (Sandbox Code Playgroud)

在我的模型上Tag.php

class Tag extends Model {
    public function test($card_id){
        return DB::SELECT(DB::RAW("SELECT name FROM tagmap tm, tags t WHERE t.id = tm.tag_id AND tm.card_id = :card_id"), ['card_id'=>$card_id]);
    }
}
Run Code Online (Sandbox Code Playgroud)

我不知道哪里失败了,哪里做错了......

谢谢....

php laravel-5

5
推荐指数
1
解决办法
2万
查看次数

如何使用jquery/javascript多个筛选器列表

我有一个html,我可以根据他们的数据进行过滤,但我不知道如何组合它.

这是我的脚本,搜索名称已经工作,但单选按钮isActive仍无法正常工作,需要在我的过滤器上添加.我不知道如何在过滤器上使用它.

$('input[type=text][name=search_name').on('input', function(e) {
  e.stopPropagation();
  e.preventDefault();

  var fullname = $(this).val();
  var isActive = $('input[type=radio][name=isActive]').val();
  searchStudent(fullname, isActive);
});

$('input[type=radio][name=isActive]').on('change', function(e) {
  e.stopPropagation();
  e.preventDefault();

  var fullname = $('input[type=text][name=search_name').val();
  var isActive = $(this).val();
  searchStudent(fullname, isActive);
});

function searchStudent(fullname, isActive) {
  $("ul li").each(function() {
    // I don't know how to add the isActive
    if ($(this).data('fullname').search(new RegExp(fullname, "i")) < 0) {
      $(this).hide();
    } else {
      $(this).show();
    }
  });
}
Run Code Online (Sandbox Code Playgroud)
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div>
  <input type="text" name="search_name">
  <span><input type="radio" checked="" autocomplete="off" value="2" name="isActive"> All</span> …
Run Code Online (Sandbox Code Playgroud)

javascript jquery

5
推荐指数
1
解决办法
438
查看次数

如何在较小和较大之间找到文本,然后在Java中删除<>?

我不知道如何找到这些单词..例子我有这个文字......

The other day I went to the <location> and bought some <plural-noun> . Afterwards, I went to <location> , but it was very <adjective> so I left quickly and went to <location> .
Run Code Online (Sandbox Code Playgroud)

当我搜索<>谷歌时,我不知道搜索的原因,它将被忽略.需要帮助如何获得此字符串.

所以我会得到<location>,<plural-noun>,<location>,<adjective>,<location>

我必须使用这种charAt()方法.我的尝试:

String string = this.fileName;
for(int i = 0; i < string.length(); i++)
                if((string.charAt(i) == '<') && (string.charAt(i) == '>'))
                    System.println(""); //<-------- IM STUCK HERE
Run Code Online (Sandbox Code Playgroud)

我不知道......差不多两天没睡觉了.

我目前但最后一个问题......如何移除<和 …

java charat

2
推荐指数
1
解决办法
791
查看次数

如何在 Laravel 上不使用 get() 启动模型

我的模型上有这个Scholar

<?php namespace App;

use Illuminate\Database\Eloquent\Model;

class Scholar extends Model {

    protected $primaryKey = 'scholar_id';
    protected $fillable = ['ngo_id','scholar_lname','scholar_fname','scholar_image','scholar_nickname','scholar_cityAddress','scholar_permaAddress','scholar_birthday','scholar_placebirth','scholar_age','scholar_gender','scholar_email','scholar_contact'];

}
Run Code Online (Sandbox Code Playgroud)

那么这是我的控制器上

$scholars = new Scholar; <------

if(Input::get('age_from'))
    $scholars->where('age', '=', Input::get('age_from'));

$scholars->get();

return $scholars;
Run Code Online (Sandbox Code Playgroud)

我想启动这个,但是当我尝试时$scholars = Scholar::all();我无法->get()再使用;

无论如何如何做这个可选的where

php model laravel eloquent

2
推荐指数
1
解决办法
2167
查看次数

Colspan 在 html5 表中无法正常工作

我在将第一行与 colspan 对齐时遇到问题,它不能正确地 colspan。这是结果:

在此输入图像描述

    .header-wrap {
      display: flex;                  
      align-items: flex-start;        
      justify-content: space-between; 
    }
    
    .header-blue   { margin-bottom: 50px; background-color: #3498DB; color: #fff; }
    .header-left   { width: 400px; text-align: left; }
    .header-left > h3 {margin: 5px 0 !important;}
    .header-right  { width: 400px; text-align: right; }
    .header-center { width: 400px; text-align: center; }
Run Code Online (Sandbox Code Playgroud)
    <table class="table table-bordered box-shadow--6dp">
      <tr class="header-blue">
        <td colspan="4" class="header-wrap">
          <div class="header-left"><h3>{{ recom.name }}</h3></div>
          <div class="header-center"><b>note:</b> {{ recom.note | displayEmpty }}</div>
          <div class="header-right"><b>Date:</b> {{ recom.date }}</div>
        </td>
      </tr>
      <tr>
        <td></td>
        <td …
Run Code Online (Sandbox Code Playgroud)

html css

1
推荐指数
1
解决办法
2590
查看次数