Welcome Guest, Not a member yet? Register   Sign In
problem with a query
#1

[eluser]lord_nerevar[/eluser]
Hi all, i'm a newbie of CI =)

I'm creating a controller that creates a temp table and populate it whit the result of a query.
my query looks like this:

CREATE TABLE match SELECT .. FROM ... WHERE ..

if i write the query directly in phpMyAdmin, the query will work perfectly, but if i insert the query in the controller, it doesn't work.

$sql = "CREATE TABLE match SELECT * FROM oggetti"; //this query is an example
$this->db->query($sql);

i receive this error:

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 'match SELECT * FROM oggetti' at line 1

CREATE TABLE match SELECT * FROM oggetti




Theme © iAndrew 2016 - Forum software by © MyBB