|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
|
|
SlickEdit: Code in over 40 languages across 7 platforms. SlickEdit’s unmatched power, speed, and flexibility allows even the most accomplished developers to write better code faster. Download a free trial today! |
|
#1
|
|||
|
|||
|
Hi,
I have a php form which inserts records into the mysql db. All the columns are getting inserted except 4 columns. My table script is this: CREATE TABLE mirs_survey1 ( qno tinyint(4) NOT NULL auto_increment, emailid varchar(255) default NULL, date date default NULL, email_alert tinyint(4) NOT NULL default '0', capitol_capsule tinyint(4) NOT NULL default '0', mirs_service tinyint(4) NOT NULL default '0', coverage_written tinyint(4) NOT NULL default '0', coverage_democrat tinyint(4) NOT NULL default '0', written_repub tinyint(4) NOT NULL default '0', ADeep tinyint(4) NOT NULL default '0', service tinyint(4) NOT NULL default '0', Mirs_update tinyint(4) NOT NULL default '0', competitor tinyint(4) NOT NULL default '0', good tinyint(4) NOT NULL default '0', accounts tinyint(4) NOT NULL default '0', list tinyint(4) NOT NULL default '0', bill tinyint(4) NOT NULL default '0', price tinyint(4) NOT NULL default '0', staff tinyint(4) NOT NULL default '0', Rreport tinyint(4) NOT NULL default '0', BCalendar tinyint(4) NOT NULL default '0', Inet tinyint(4) NOT NULL default '0', Attn tinyint(4) NOT NULL default '0', version tinyint(4) NOT NULL default '0', email tinyint(4) NOT NULL default '0', Mirs_text tinyint(4) NOT NULL default '0', list_fundraisers tinyint(4) NOT NULL default '0', content_capsule tinyint(4) NOT NULL default '0', Mirs_content tinyint(4) NOT NULL default '0', Mirs_cover tinyint(4) NOT NULL default '0', Mirs_delivery tinyint(4) NOT NULL default '0', Mirs_online tinyint(4) NOT NULL default '0', Mirs_search tinyint(4) NOT NULL default '0', Mirs_newsemail tinyint(4) NOT NULL default '0', Mirs_anotherletter tinyint(4) NOT NULL default '0', Mirs_otherbipolitical tinyint(4) NOT NULL default '0', Mirs_servicecharge tinyint(4) NOT NULL default '0', Mirs_keyissues tinyint(4) NOT NULL default '0', Mirs_othernewsletters tinyint(4) NOT NULL default '0', Mirs_providemore tinyint(4) NOT NULL default '0', Mirs_judicial tinyint(4) NOT NULL default '0', mirs_aspects varchar(255) default NULL, mirs_likeleast varchar(255) default NULL, PRIMARY KEY (qno), UNIQUE KEY qno (qno), KEY qno_2 (qno), FULLTEXT KEY emailid (emailid) ) The column that is not getting inserted are mirs_aspects varchar(255) default NULL, mirs_likeleast varchar(255) default NULL, emailid varchar(255) default NULL, date date default NULL, the script can be acessed online at (http://www.enddebtmisery.com/sri/survey.php). Any thoughts/ideas? Thanks Sri |
|
#2
|
|||
|
|||
|
first thought
declare the "default NULL" items as just "NULL"
also, why declare date as default null? why not default 0000-00-00 . that's much more sensible |
|
#3
|
|||
|
|||
|
Did not help though??
Thanks Sri |
|
#4
|
|||
|
|||
|
OMG, im only 19 and i think you just gave me a heart attack!
OK. *breath in, breath out*, firstly ive look over the sytax and it should work, what i suggest that you do is, create a table with fields that you having problems with, see if that will create those fields. Also did you type this query by hand or was it created by phpmyadmin, etc?? |
![]() |
| Viewing: Dev Articles Community Forums > Programming > General Programming Help > Inserting records into DB trouble |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|