Thanks for the link Zenry! Sorry to say that I still don't get it.
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");
$db = DB::connection();
$sql = "CREATE TABLE IF NOT EXISTS ".$testname." ( id INT, user VARCHAR(30), questn VARCHAR(30), ans VARCHAR(30))";
$db->statement($sql);
$sql = "INSERT IGNORE INTO ".$testname." SELECT * FROM test";
$db->statement($sql);
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community