这是表结构
-- 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 ;
并且继承了我正在尝试的SQL查询:
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:"";}'
我试图通过phpmyadmin来做,它说添加了一行,并给了我行ID ...但是表格保持空白!!!
答案 0 :(得分:1)
请使用此语法,它肯定会起作用:
INSERT INTO tablename(col1,col2)VALUES('data1','data2')
以下是一些例子:
答案 1 :(得分:0)
您尚未设置fetched_ts
并将其定义为NOT NULL
。
否则,您可以运行以下查询:
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')
;
//其中1111111是fetched_ts