Welcome Guest, Not a member yet? Register   Sign In
Newb, having problems with Active Record, results in syntax error
#1

[eluser]Unknown[/eluser]
I've written some php with codeigniter which gets some info from an XML document, and then tries to save it to my db.

However trying to use active record, for inserting to the database, results in a syntax error.

my code:

$data['director'] = $movie->directors->director;
$data['spilletid'] = $movie->movie_duration;
$data['premiere'] = $movie->regions->region->products->product->premiere;
$data['type'] = $movie->regions->region->categories->categorie;

$this->db->insert('movies_trailer', $data);

And this is the syntax error:

A Database Error Occurred
Error Number: 1064

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 'the Universe, 709, Julie Taymor, 134, 2008-06-20, Drama)' at line 1

INSERT INTO `movies_trailer` (`title`, `movie_id`, `director`, `spilletid`, `premiere`, `type`) VALUES (Across the Universe, 709, Julie Taymor, 134, 2008-06-20, Drama)

Can anyone tell me what I am doing wrong?


Messages In This Thread
Newb, having problems with Active Record, results in syntax error - by El Forum - 12-29-2008, 05:07 AM



Theme © iAndrew 2016 - Forum software by © MyBB