Reputation: 4773
here's the table structure
-- phpMyAdmin SQL Dump
-- version 3.4.10.1
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Aug 01, 2012 at 12:20 PM
-- Server version: 5.1.63
-- PHP Version: 5.2.6
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
--
-- Database: `beta2_fetcher`
--
-- --------------------------------------------------------
--
-- Table structure for table `rss_fetch_stack`
--
CREATE TABLE IF NOT EXISTS `rss_fetch_stack` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`sourceData` text CHARACTER SET utf8 NOT NULL,
`sourceId` int(11) NOT NULL,
`ts` int(11) NOT NULL,
`fetched_ts` int(11) NOT NULL,
`fetch_status` int(11) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `sourceId` (`sourceId`,`fetch_status`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=6866 ;
and heres the sql query i am trying to do :
insert into rss_fetch_stack set ts = '1343840864' , fetch_status='0', sourceId='42312' , sourceData='O:8:"stdClass":26:{s:2:"id";s:2:"12";s:7:"site_id";s:1:"3";s:5:"title";s:25:"عربي";s:3:"url";s:50:"someXML";s:7:"groupId";s:1:"0";s:8:"category";s:1:"6";s:7:"enabled";s:1:"1";s:13:"bypassCompare";s:1:"0";s:7:"isInner";s:1:"0";s:8:"useProxy";s:1:"0";s:8:"autoPush";s:1:"0";s:11:"autoPushAge";s:1:"0";s:13:"autoPushCount";s:1:"0";s:12:"byWordFilter";s:1:"0";s:15:"publishInterval";s:2:"10";s:12:"publishCount";s:1:"1";s:6:"preURL";s:0:"";s:7:"postURL";s:0:"";s:9:"deleteURL";s:0:"";s:8:"preTitle";s:0:"";s:9:"postTitle";s:0:"";s:11:"deleteTitle";s:0:"";s:12:"maxFetchNews";s:1:"0";s:13:"fetchInterval";s:1:"2";s:10:"wordFilter";s:0:"";s:11:"blockFilter";s:0:"";}'
i am trying to do it via phpmyadmin , it says one row added , and gives me the row ID ... but the table stays empty !!!
Upvotes: 1
Views: 4092
Reputation: 5685
You have not set fetched_ts
and defined it as NOT NULL
.
Else you can run query like:
insert into rss_fetch_stack values ( 'O:8:"stdClass":26:{s:2:"id";s:2:"12";s:7:"site_id";s:1:"3";s:5:"title";s:25:"عربي";s:3:"url";s:50:"someXML";s:7:"groupId";s:1:"0";s:8:"category";s:1:"6";s:7:"enabled";s:1:"1";s:13:"bypassCompare";s:1:"0";s:7:"isInner";s:1:"0";s:8:"useProxy";s:1:"0";s:8:"autoPush";s:1:"0";s:11:"autoPushAge";s:1:"0";s:13:"autoPushCount";s:1:"0";s:12:"byWordFilter";s:1:"0";s:15:"publishInterval";s:2:"10";s:12:"publishCount";s:1:"1";s:6:"preURL";s:0:"";s:7:"postURL";s:0:"";s:9:"deleteURL";s:0:"";s:8:"preTitle";s:0:"";s:9:"postTitle";s:0:"";s:11:"deleteTitle";s:0:"";s:12:"maxFetchNews";s:1:"0";s:13:"fetchInterval";s:1:"2";s:10:"wordFilter";s:0:"";s:11:"blockFilter";s:0:"";}',
'42312', '1343840864' , '111111111', '0')
;
//where 1111111 is fetched_ts
Upvotes: 0
Reputation: 958
Use this syntax instead, it will definitely work:
INSERT INTO tablename (col1, col2) VALUES('data1', 'data2' )
Here's some examples:
Upvotes: 0