dimanche 27 septembre 2015

Inserting a variable in sql through laravel

I am trying to insert data into sql in laravel 5 My Code:

$a1=Input::get('username');

$a2=Input::get('reg_no');

DB::insert("INSERT INTO table1 VALUES($a1,$a2)");

But I am getting SQL syntax error PLZZ HELP.



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/1O3npvd
via IFTTT

Aucun commentaire:

Enregistrer un commentaire