Getting MySQL error 1064 when performing an INSERT query?

You need to escape the quotes on (at least) the 'description' field before entering it into the db: foreach($xml->channel->item as $item) { $this->query = $this->db->query(" INSERT INTO `feed_items` (`feed_id`, `guid`, `publish_date`, `update_of`, `link`, `title`, `description`, `comments_link`) VALUES ('{$feed'id'}', '{$item->guid}', '{$item->pubDate}', NULL, '{$item->link}', '{$item->title}', '" . Mysql_real_escape_string($item->description). "', NULL) "); } Although I'm not sure if mysql_real_escape_string is what's used that much now.

This worked. It's always something simple. Thanks!

– Kylee Oct 4 '09 at 21:20 The title field too I believe, not just description but same principle – meder Oct 4 '09 at 21:24.

That seems risky though. Is it a static page that you're serving?', 'kyct: @jtkendall Edit your $config'permitted_uri_chars'? That seems risky though.

Is it a static page that you're serving?' You need to escape the single quotes, like so: "INSERT INTO `feed_items` (`feed_id`, `guid`, `publish_date`, `update_of`, `link`, `title`, `description`, `comments_link`) VALUES ('{$feed'id'}', '{$item->guid}', '{$item->pubDate}', NULL, '{$item->link}', '" . Mysql_real_escape_string($item->title) . "', '" .

Mysql_real_escape_string($item->description) . "', NULL).

Try my latest updated version which should account for the item title and description. – meder Oct 4 '09 at 21:18.

That seems risky though. INSERT INTO `feed_items` (`feed_id`, `guid`, `publish_date`, `update_of`, `link`, `title`, `description`, `comments_link`) VALUES ('2', 'twitter.com/kyct/statuses/4131154118', 'Sun, 20 Sep 2009 20:54:41 +0000', NULL, 'twitter.com/kyct/statuses/4131154118', 'kyct: @jtkendall Edit your $config'permitted_uri_chars'? That seems risky though.

Is it a static page that you're serving?', 'kyct: @jtkendall Edit your $config'permitted_uri_chars'?

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions