Welcome Guest, Not a member yet? Register   Sign In
How can you run an mysqli query?
#1

[eluser]radu.v.valentin[/eluser]
Hello guys,

Does anyone have a clue how to run a mysqli query with CI. I did change the db driver in the config file, but I'm still unable to use multiple queries like

Code:
$sql = "SELECT * FROM c WHERE 1;
        DROP TABLE IF EXISTS c;"
$query = $this->db->query($sql);



Anyone has any clue how to do this using only CI, no additional libraries, because theoretically CI supports mysqli.

Thanks
#2

[eluser]WanWizard[/eluser]
CI doesn't support multiple SQL statements in one go.

Use
Code:
$sql = "SELECT * FROM c WHERE 1";
$query = $this->db->query($sql);

$sql = "DROP TABLE IF EXISTS c;";
$query = $this->db->query($sql);
#3

[eluser]radu.v.valentin[/eluser]
Hi WanWizard,

Thanks for the reply, that a bad news indeed, as I have a complex SQL script that I'll have to split. Well, to bad...

Regards,
R.




Theme © iAndrew 2016 - Forum software by © MyBB