Date: January 22, 2011

Need some help to solve this error. Nothing similar in the forum, IMHO.


phpMyAdmin – 3.3.9 with this info:
# Version MySQL client: 5.0.51a
# Version MySQL: 5.0.45
# Server: Localhost via WAMPSERVER 2.1
# PHP 5.2.6
# Apache 2.050

DROP TABLE IF EXISTS `products_description`;
CREATE TABLE IF NOT EXISTS `products_description` (
`products_id` int(11) NOT NULL auto_increment,
`language_id` int(11) NOT NULL default '1',
`products_name` varchar(64) NOT NULL default '',
`products_description` longtext,
`products_url` varchar(255) default NULL,
`products_viewed` int(5) default NULL,
`products_seo_url` varchar(100) NOT NULL,
`products_head_title_tag` varchar(80) default NULL,
`products_head_desc_tag` longtext,
`products_head_keywords_tag` longtext,
PRIMARY KEY (`products_id`,`language_id`),
KEY `products_name` (`products_name`)

Error occurs when try to insert the page on the web.

The error:
1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '0, products_url, products_head_title_tag, products_head_desc_tag, products_head_' at line 1

insert into products_description (products_name, products_short, products_description, 0, products_url, products_head_title_tag, products_head_desc_tag, products_head_keywords_tag, products_id, language_id) values ('Adotation', '', 'Array', 'L\'Adoration des mages est un thème de l\'iconographie de la peinture chrétienne, etc, ,,.', '', 'Contrairement à beaucoup de tableau', 'seule architecture visible', 'avec des monts au lo', '222', '1')

What looks strange is that:
- products_description is populated as 'Array',and
- 0 (field not in the table ??) is populated as what should be the text corresponding to products_description ('L\'Adoration des mages est un thème de l\'iconographie....).

Is someone can help me to solve this problem et explain what about this inversion.

Any help will be pareciated.


E. P.

Recommended Answers

All 3 Replies

You cannot have a field named 0 in your field list. Are you feeding the database via phpMyAdmin? How do you prepare your insert statement?

You are right. There is neither field '0' nor 'Array' in the table. That's what is so strange and ununderstable for me.

I use the SQL statement to feed the database via PhpMyAdmin

What is the statement which you enter into the "SQL statement" field of phpMyAdmin? Can you use the mysql command line client instead?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.