Support the ongoing development of Laravel.io →
posted 8 years ago
Database
Last updated 10 months ago.
0

Okay, it seems I've found a solution. Can I do it this way?

$res = DB::connection('mysql')->statement("CREATE DATABASE IF NOT EXISTS `{$mysqlDatabaseName}`");
$res2 = DB::connection('mysql')->statement("CREATE USER '{$mysqlDatabaseName}'@'%' IDENTIFIED BY '{$mysqlPassword}');

Or would I have SQL-injection problems?

Thanks again, Alessio Periloso

Last updated 10 months ago.
0

How would I do this if I am wanting to use sqlite in testing?

0

Sign in to participate in this thread!

LaraJobs

Your banner here too?

periloso periloso Joined 14 Jul 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2023 Laravel.io - All rights reserved.