Support the ongoing development of Laravel.io →
posted 10 years ago
Database
Last updated 2 years 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 2 years ago.
0

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

0

Sign in to participate in this thread!

Eventy

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.

© 2024 Laravel.io - All rights reserved.