This is a discussion on "Error 1136" within the Databases section. This forum, and the thread "Error 1136 are both part of the Program Your Website category.
|
|
|
|
|
![]() |
||
Error 1136
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
#1
|
||||
|
||||
|
Error 1136
This simple problem drove me nuts yesterday. I can recreate the problem. Take this simple table I just created using php MyAdmin:
I now run the following simple query directly in SQL:
I have a lot of tables in this database of all sizes and shapes, some of them with the same format DATE. They all work great -- I have never seen this before. I have even tried copying other (functional) tables' structures and then eliminating columns, and I still come down to this blasted 1136 error. PS - I don't think it has anything to do with the INSERT query, as I have tried every size and shape of query I could come up with. Last edited by masonbarge; Aug 5th, 2006 at 11:56. |
|
|
|
#2
|
||||
|
||||
|
Re: Error 1136
Well I finally got this to work but just by tinkering -- I still have no clue as to what's going on.
I changed the default date to 2006-01-01, which didn't do it. However, the table accepted the following query:
|
|
#3
|
|||
|
|||
|
Re: Error 1136
As i understand it the reason
INSERT INTO history (content, date) VALUES ('blahblah'),('2006-08-03'); doesnt work is that VALUES ('blahblah'),('2006-08-03'); should be VALUES ('blahblah', '2006-08-03'), but sepparating the blah and date with the () makes mysql thinks you are trying to insert another row into the history table, and so of course you dont have the same number of input values to inputfields specified. This is useful though cos you can do this INSERT INTO history (content, date) VALUES ('content1', '2006-08-03'), ('content2', '2006-07-05'), which will insert two rows in one query |
|
#4
|
|||
|
|||
|
Re: Error 1136
Gee Bee has it right. The reason for the 1136 error is the total amount of fields does not match when trying to INSERT a value in a table.
|
|
#5
|
||||
|
||||
|
Re: Error 1136
Thanks for pointing that out. As is true 99% of the time, it isn't some erudite point of programming, just a dumb syntax error.
|
![]() |
| Tags |
| error, 1136 |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| [SOLVED] Getting the "Microsoft JET Database Engine error '80040e14'" error. | VegaLA | Classic ASP | 3 | Jan 26th, 2008 00:12 |
| Keep getting error message Microsoft VBScript runtime error '800a01a8' | cpando1974 | Classic ASP | 2 | Aug 7th, 2007 12:00 |
| Error 500 - Internal server error | JasonStanley | PHP Forum | 3 | Apr 23rd, 2007 17:56 |