In the mysql CLI I have prepared a statement like this:
PREPARE registrarUser FROM 'INSERT INTO Users (Users_name,Email,pass) values (?,?,?)'
In my database the prepared statements have to be done this way,instead of using a php method like this::
$conn->prepare("INSERT INTO Users (Users_name,Email,pass) VALUES (?, ?, ?)");
So I can't use the prepared statement or bind arguments.
I have tried this query which mimics the required statements in mysql CLI
$query = sprintf('
SET @Users_name = "%s";
SET @Email= "%s";
SET @pass = "%s";
EXECUTE registrarUser USING @Users_name, @Email, @pass;',$Users_name,$Email,$pass);
But it returns the following syntax error:
Errormessage: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'SET @Email= "eds@gmail.com"; SET @pass = "Thinkshap2"; EXECUTE registrar' at line 2
Does anyone know if there is a way to do it? Thank you very much in advance;