Answer the question
In order to leave comments, you need to log in
Why is the submitted data not visible in the database?
I am new to laravel learning to send data with DB facade.
Submitted data using this code
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
class CreateController extends Controller
{
public function index(Request $request)
{
$title = $request->title;
$text = $request->text;
\DB::insert("INSERT INTO `posts` (`title`, `text`) VALUES (?, ?)", ['$title', '$text']);
return view('create');
}
}
Answer the question
In order to leave comments, you need to log in
Я новичок в laravel
------------------------
Теперь проблема в том что вместо отправленных данных в phpMyAdmin в полях таблицы стоят не отправленные данные а переменные $title и $text <---вот прям вот так и написано
By the looks of it, you're new to not only Laravel, but PHP too. As well as programming in general Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question