After solve the issue to create a database using shell_script in php, see this post link, I was trying to create tables inside the same shell_exec command.
I have these lines:
$sql="CREATE DATABASE IF NOT EXISTS dbtest; use dbtest; CREATE TABLE MyGuests (
id INT(6) UNSIGNED AUTO_INCREMENT PRIMARY KEY,
firstname VARCHAR(30) NOT NULL,
lastname VARCHAR(30) NOT NULL,
email VARCHAR(50),
reg_date TIMESTAMP
) ";
shell_exec("mysql -uroot -pmypasswrd -e \"$sql\" ");
This code only creates the database, but not creates the table. My question is how accomplish this task using shell_exec()? Is it possible to run a sql satatment that comes from a mysqldump using shell_exec()?