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 PLEASE HELP.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire