473,376 Members | 1,218 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,376 software developers and data experts.

an error in insert into table

107 100+
i have an error with enter record to table in database(mysql)
structure of my table is as follow

Expand|Select|Wrap|Line Numbers
  1. - phpMyAdmin SQL Dump
  2. -- version 2.11.6
  3. -- http://www.phpmyadmin.net
  4. --
  5. -- Host: localhost
  6. -- Generation Time: Jan 21, 2009 at 12:12 PM
  7. -- Server version: 5.0.51
  8. -- PHP Version: 5.2.6
  16. /*!40101 SET NAMES utf8 */;
  18. --
  19. -- Database: `shop_mobile`
  20. --
  22. -- --------------------------------------------------------
  24. --
  25. -- Table structure for table `tbl_phone`
  26. --
  28. CREATE TABLE `tbl_phone` (`id_phone` INT NOT NULL AUTO_INCREMENT, `username` varchar(20) NOT NULL,
  29.   `current_time` varchar(20) NOT NULL COMMENT 'زمان ورود رکورد',
  30.   `mark` varchar(20) character set utf8 collate utf8_unicode_ci NOT NULL COMMENT 'برند',
  31.   `seri` varchar(20) NOT NULL COMMENT 'سری',
  32.   `photo` varchar(60) NOT NULL COMMENT 'عکس',
  33.   `price` varchar(10) NOT NULL COMMENT 'قیمت',
  34.   `guaranty` varchar(30) character set utf8 collate utf8_unicode_ci NOT NULL COMMENT 'گارانتی',
  35.   `state_guaranty` varchar(30) character set utf8 collate utf8_unicode_ci default NULL COMMENT 'وضعیت گارانتی',
  36.   `available` varchar(30) character set utf8 collate utf8_unicode_ci default NULL COMMENT 'موجود بودن  گوشی',
  37.   `create_date` varchar(30) character set utf8 collate utf8_unicode_ci default NULL COMMENT 'تاریخ معرفی گوشی',
  38.   `frequence` varchar(20) default NULL COMMENT 'باند فرکانس',
  39.   `dimension_phone` varchar(20) default NULL COMMENT 'ابعاد گوشی',
  40.   `weight_phone` varchar(10) default NULL COMMENT 'وزن گوشی',
  41.   `look_phone` varchar(30) character set utf8 collate utf8_unicode_ci default NULL COMMENT 'شکل ظاهری گوشی',
  42.   `color_phone` varchar(30) character set utf8 collate utf8_unicode_ci default NULL COMMENT 'رنگ های گوشی',
  43.   `type_screen` varchar(20) default NULL COMMENT 'نوع صفحه نمایش',
  44.   `count_color_screen` varchar(20) default NULL COMMENT 'تعداد رنگهای صفحه نمایش',
  45.   `transparency_screen` varchar(10) default NULL COMMENT 'وضوح صفحه نمایش',
  46.   `external_screen` varchar(30) character set utf8 collate utf8_unicode_ci default NULL COMMENT 'صفحه نمایش خارجی',
  47.   `dimension_screen` varchar(10) default NULL COMMENT 'ابعاد صفحه نمایش',
  48.   `diagnose_handwiting` varchar(30) character set utf8 collate utf8_unicode_ci default NULL COMMENT 'تشخیص دست نوشته',
  49.   `type_alarm` varchar(30) character set utf8 collate utf8_unicode_ci default NULL COMMENT 'نوع زنگ',
  50.   `recieve_alarm` varchar(30) character set utf8 collate utf8_unicode_ci default NULL COMMENT 'دریافت زنگ',
  51.   `vibrate` varchar(30) character set utf8 collate utf8_unicode_ci default NULL COMMENT 'لرزاننده',
  52.   `telephonebook` varchar(30) character set utf8 collate utf8_unicode_ci default NULL COMMENT 'دفترچه تلفن',
  53.   `report_call` varchar(30) character set utf8 collate utf8_unicode_ci default NULL COMMENT 'گزارش تماس',
  54.   `internal_memory` varchar(30) character set utf8 collate utf8_unicode_ci default NULL COMMENT 'حافظه داخلی',
  55.   `card_memory` varchar(30) character set utf8 collate utf8_unicode_ci default NULL COMMENT 'کارت حافظه',
  56.   `card_memory_mobile` varchar(30) character set utf8 collate utf8_unicode_ci default NULL COMMENT 'کارت حافظه همراه',
  57.   `type_card_memory` varchar(20) default NULL COMMENT 'نوع کارت حافظه',
  58.   `enhance_memory` varchar(30) character set utf8 collate utf8_unicode_ci default NULL COMMENT 'قابلیت ارتقا',
  59.   `properties_else` varchar(60) character set utf8 collate utf8_unicode_ci default NULL COMMENT 'خصوصیات دیگر حافظه',
  60.   `bluetooth` varchar(30) character set utf8 collate utf8_unicode_ci default NULL COMMENT 'بلوتوث',
  61.   `ifrared` varchar(30) character set utf8 collate utf8_unicode_ci default NULL COMMENT 'مادون قرمز',
  62.   `usb` varchar(30) character set utf8 collate utf8_unicode_ci default NULL COMMENT 'USB',
  63.   `mathching_computer` varchar(30) character set utf8 collate utf8_unicode_ci default NULL COMMENT 'تطبیق  با کامپیوتر',
  64.   `type_message` varchar(30) default NULL COMMENT 'دریافت پیام',
  65.   `wireless_network` varchar(30) character set utf8 collate utf8_unicode_ci default NULL COMMENT 'شبکه بی سیم',
  66.   `browser_internet` varchar(30) default NULL COMMENT 'مرورگر اینترنت',
  67.   `GPRS` varchar(30) character set utf8 collate utf8_unicode_ci default NULL COMMENT 'GPRS',
  68.   `HSCSD` varchar(30) character set utf8 collate utf8_unicode_ci default NULL COMMENT 'HSCSD',
  69.   `EDGE` varchar(30) character set utf8 collate utf8_unicode_ci default NULL COMMENT 'EDGE',
  70.   `threeG` varchar(30) character set utf8 collate utf8_unicode_ci default NULL COMMENT '3G',
  71.   `quality_photo` varchar(20) default NULL COMMENT 'کیفیت عکس',
  72.   `dimension_photo` varchar(20) default NULL COMMENT 'ابعاد عکس',
  73.   `zoom_photo` varchar(30) character set utf8 collate utf8_unicode_ci default NULL COMMENT 'بزرگنمائی',
  74.   `flash_photo` varchar(30) character set utf8 collate utf8_unicode_ci default NULL COMMENT 'فلاش',
  75.   `record_film` varchar(30) character set utf8 collate utf8_unicode_ci default NULL COMMENT 'فیلمبرداری',
  76.   `record_film_time` varchar(30) character set utf8 collate utf8_unicode_ci default NULL COMMENT 'مدت فیلمبرداری',
  77.   `dimension_film` varchar(20) default NULL COMMENT 'ابعاد فیلم',
  78.   `auto_focus` varchar(30) character set utf8 collate utf8_unicode_ci default NULL COMMENT 'فوکوس خودکار',
  79.   `second_camera` varchar(30) character set utf8 collate utf8_unicode_ci default NULL COMMENT 'دوربین دوم',
  80.   `picture_call` varchar(30) character set utf8 collate utf8_unicode_ci default NULL COMMENT 'تماس تصویری',
  81.   `type_lens` varchar(20) default NULL COMMENT 'نوع لنز',
  82.   `os` varchar(20) default NULL COMMENT 'سیستم عامل',
  83.   `cpu` varchar(20) default NULL COMMENT 'cpu',
  84.   `distribute_film` varchar(30) character set utf8 collate utf8_unicode_ci default NULL COMMENT 'پخش فیلم',
  85.   `distribute_music` varchar(30) character set utf8 collate utf8_unicode_ci default NULL COMMENT 'پخش موسیقی',
  86.   `radio` varchar(30) character set utf8 collate utf8_unicode_ci default NULL COMMENT 'رادیو',
  87.   `working_office_document` varchar(30) character set utf8 collate utf8_unicode_ci default NULL COMMENT 'کار با پرونده های آفیس',
  88.   `working_pdf_document` varchar(30) character set utf8 collate utf8_unicode_ci default NULL COMMENT 'کار با پرونده های پی دی اف',
  89.   `pin_output_sound` varchar(30) character set utf8 collate utf8_unicode_ci default NULL COMMENT 'پایه خروجی صدا',
  90.   `distribute_loud_sound` varchar(30) character set utf8 collate utf8_unicode_ci default NULL COMMENT 'پخش با صدای بلند',
  91.   `oclock` varchar(30) character set utf8 collate utf8_unicode_ci default NULL COMMENT 'ساعت',
  92.   `alarm_oclock` varchar(30) character set utf8 collate utf8_unicode_ci default NULL COMMENT 'زنگ هشدار',
  93.   `java` varchar(20) character set utf8 collate utf8_unicode_ci default NULL COMMENT 'java',
  94.   `game` varchar(30) character set utf8 collate utf8_unicode_ci default NULL COMMENT 'بازی',
  95.   `game_install` varchar(30) character set utf8 collate utf8_unicode_ci default NULL COMMENT 'نصب بازی',
  96.   `anticipate_word` varchar(30) character set utf8 collate utf8_unicode_ci default NULL COMMENT 'پیش بینی کلمه',
  97.   `command_voice` varchar(30) character set utf8 collate utf8_unicode_ci default NULL COMMENT 'فرمان صوتی',
  98.   `dialing_voice` varchar(30) character set utf8 collate utf8_unicode_ci default NULL COMMENT 'شماره گیر صوتی',
  99.   `record_sound` varchar(30) character set utf8 collate utf8_unicode_ci default NULL COMMENT 'ضبط صدا',
  100.   `output_tv` varchar(30) character set utf8 collate utf8_unicode_ci default NULL COMMENT 'خروجی تلویزیون',
  101.   `management_person` varchar(60) character set utf8 collate utf8_unicode_ci default NULL COMMENT 'مدیریت  اطلاعات شخصی',
  102.   `edit_photo` varchar(30) character set utf8 collate utf8_unicode_ci default NULL COMMENT 'ویرایش عکس',
  103.   `sensor_moving` varchar(30) character set utf8 collate utf8_unicode_ci default NULL COMMENT 'سنسور حرکتی',
  104.   `special_popular_properties` varchar(60) character set utf8 collate utf8_unicode_ci default NULL COMMENT 'مشخصات ویژه این مدل',
  105.   `type_battery` varchar(40) character set utf8 collate utf8_unicode_ci default NULL COMMENT 'نوع باتری',
  106.   `dialog` varchar(20) character set utf8 collate utf8_unicode_ci default NULL COMMENT 'مکالمه',
  107.   `waiting` varchar(20) character set utf8 collate utf8_unicode_ci default NULL COMMENT 'انتظار',PRIMARY KEY(`id_phone`)) ENGINE=InnoDB DEFAULT CHARSET=latin1;
  109. --
  110. -- Dumping data for table `tbl_phone`
  111. --
and i wanted to insert into this table with this statement

Expand|Select|Wrap|Line Numbers
  1. INSERT INTO tbl_phone (username,current_time,mark,seri,photo,price,guaranty,state_guaranty,available,create_date,frequence,dimension_phone,weight_phone,look_phone,color_phone,type_screen,count_color_screen,transparency_screen,external_screen,dimension_screen,diagnose_handwiting,type_alarm,recieve_alarm,vibrate,telephonebook,report_call,internal_memory,card_memory,card_memory_mobile,type_card_memory,enhance_memory,properties_else,bluetooth,ifrared,usb,mathching_computer,type_message,wireless_network,browser_internet,GPRS,HSCSD,EDGE,threeG,quality_photo,dimension_photo,zoom_photo,flash_photo,record_film,record_film_time,dimension_film,auto_focus,second_camera,picture_call,type_lens,os,cpu,distribute_film,distribute_music,radio,working_office_document,working_pdf_document,pin_output_sound,distribute_loud_sound,oclock,alarm_oclock,java,game,game_install,anticipate_word,command_voice,dialing_voice,record_sound,output_tv,management_person,edit_photo,sensor_moving,special_popular_properties,type_battery,dialog,waiting) VALUES 
  2. ('ali123','2009-January-31','nokia','11000','..\\uploaded_file\\pic_71.gif','11000','no','','no','2004 January','','','','','','','','','no','','no','','no','no','','no','','no','no','','','','no','no','no','no','','no','','no','no','no','no','','','no','no','no','','','no','no','no','','','','no','no','no','no','no','no','no','no','no','no','no','no','no','no','no','no','no','','no','no','','','','no' )

that ' ..\\uploaded_file\\pic_71.gif' is address of picture is uploaded
but i get an error as follow

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 'current_time,mark,seri,photo,price,guaranty,state _guaranty,available,create_date' at line 1

I check table and my insert statement for this error for several time but I dont understand reason of this error.
please help me that what is reason of this error?

thanks alot
Feb 3 '09 #1
1 2867
5,058 Expert 4TB

The word "current_time" is a reserved keyword in MySQL.
Try enclosing it in back-ticks, like it is in your CREATE TABLE query.
Feb 4 '09 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

by: Robert Rae | last post by:
OS XP Pro SP2 MYSQL Ver: 5.0.0-alpha nt Whenever I view a table or run a query in the Control Center (0.9.4-beta) I get the following error: ERROR 1146: Table 'shipnet.1' doesn't exist ...
by: Dino Vliet | last post by:
Hi there, I want to put a number of records (variable number depending on a attribute of a table) into a certain table with a trigger statement. I have created the follwing trigger: CREATE...
by: tyngtyng | last post by:
hi... i'm new to the php and now i'm getting an error to insert my data inside the form..and also undefined index in latest_updated...... Now,i'm having trouble catching what i'm doing...
by: ineedahelp | last post by:
Can anyone help me figure out why I continue to get a runtime error '3010' "TABLE qryMultiSelect ALREADY EXISTS'? Here is my code. thank you in advance for any help!!! Private Sub...
by: quartz | last post by:
Hello, I have a txt file with names, years, days. How can I insert table using shell scripting??? Thenks a lot,
by: jongerb | last post by:
Hello, I've been working on taking data from a form and inserting it to a table if the record doesn't exist and updating it if the record does exists. All the data is in textboxes and a comboboxes....
by: JoeKid09 | last post by:
Hi Guys, Thanks in advance for your help. I unpivoted a table which I want to insert into another table. Below is my script. I got an error; anyone can see where my error is. insert into...
by: tvnaidu | last post by:
Getting an error "table insert failed for eventLog" any idea what is the reason?, I have this table called "eventLog", earlier DB comesup, now I saved more data and I am getting the above error when...
by: tvnaidu | last post by:
database file gets created using below sql file, then lua script calls "db.import config_ascc", then I get errors says "insert table failed for eventLog", below are my sql file entry, config file,...
by: tvnaidu | last post by:
When I do INSERT like below, value is a string with apastrophe (for ex: "Checking for 'hlt' instruction"), insert throws an error - how to fix? INSERT INTO table_name (column1, column2,...
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.