小编san*_*iYW的帖子

SQLSTATE [42S22]:未找到列:1054'where子句'中的未知列'id'(SQL:select*from`songs`其中`id` = 5 limit 1)

我试图通过使用列SongID在用户单击链接时从数据库中获取特定数据,但我收到此错误:

SQLSTATE [42S22]:未找到列:1054'where子句'中的未知列'id'(SQL:select*from songswhere id= 5 limit 1)

控制器类:

<?php namespace App\Http\Controllers;

use App\Http\Requests;
use App\Http\Controllers\Controller;

use Illuminate\Http\Request;
use DB;

class SongsController extends Controller {
    public function index()
    {
        $name = $this->getName();
        $songs = DB::table('songs')->get();
        return view('songs.index', compact('songs','name'));
    }
    public function show($id)
    {
        $name = $this->getName();
        $song = DB::table('songs')->find($id);
        return view('songs.show', compact('song','name'));
    }

    private function getName()
    {
        $name = 'Tupac Amaru Shakur';
        return $name;
    }
}
Run Code Online (Sandbox Code Playgroud)

移民:

    public function up()
    {
            Schema::create('songs', function($table)
            {
                $table->increments('SongID');
                $table->string('SongTitle')->index(); …
Run Code Online (Sandbox Code Playgroud)

php mysql laravel laravel-5

27
推荐指数
3
解决办法
8万
查看次数

使用 getuserMedia() Javascript 拍摄的图像分辨率不佳

我想使用 javascript getUserMedia 函数从手机摄像头截取屏幕截图,但分辨率非常差。

if (navigator.mediaDevices) {
  // access the web cam
  navigator.mediaDevices.getUserMedia({
   video: {
    width: { 
     min: 1280,
    },
    height: {
     min: 720,
    },
    facingMode: {
     exact: 'environment'
    }
   }
  }).then(function(stream) {
      video.srcObject = stream;
      video.addEventListener('click', takeSnapshot);
  })
  .catch(function(error) {
      document.body.textContent = 'Could not access the camera. Error: ' + error.name;
  });
}


var video = document.querySelector('video'), canvas;

function takeSnapshot(){
  var img =  document.createElement('img');
  var context;
  var width = video.offsetWidth, height = video.offsetHeight;
  var canvas = document.createElement('canvas');
    canvas.width = …
Run Code Online (Sandbox Code Playgroud)

html javascript camera getusermedia

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

标签 统计

camera ×1

getusermedia ×1

html ×1

javascript ×1

laravel ×1

laravel-5 ×1

mysql ×1

php ×1