I want to know how to copy existing table in Laravel? I am new to Laravel
. I am trying to make an online exam application. I want to create a table for each user and copy all the contents of the exam table to this newly created table.
This is the script that I wanted to do. It works fine when not in laravel. What is the laravel way to do this?
$check = mysql_query("CREATE TABLE IF NOT EXISTS ".$testname." ( id INT, user VARCHAR(30), questn VARCHAR(30), ans VARCHAR(30))");
mysql_query ("INSERT IGNORE INTO ".$testname." SELECT * FROM test");