473,396 Members | 1,892 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,396 software developers and data experts.

Error .... right syntax to use near ' 0, '1',

Hello im making a browser game and have 99% working but iv got one error i cant find / fix and would like to know if anyone can help me where im going wrong heres the error
Expand|Select|Wrap|Line Numbers
  1. QUERY ERROR: 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, '1', '2121221', '1212121', '12121', '12121', 1211, '121', 121)' at line 1
  2. Query was INSERT INTO crimes (crimeNAME, crimeBRAVE, crimePERCFORM, crimeSUCCESSMUNY, crimeSUCCESSCRYS, crimeSUCCESSITEM, crimeGROUP, crimeITEXT, crimeSTEXT, crimeFTEXT, crimeJTEXT, crimeJAILTIME, crimeJREASON, crimeXP) VALUES( 'fdfdf', '1', '((WILL*0.8)/2.5)+(LEVEL/4)', '12', , 0, '1', '2121221', '1212121', '12121', '12121', 1211, '121', 121)
Expand|Select|Wrap|Line Numbers
  1. '12', , 0, '1', '2121221', '1212121', '12121', '12121', 1211, '121', 121
this is where i would write but for the testing i did anything

here is the coding to the table in mysql
Expand|Select|Wrap|Line Numbers
  1. CREATE TABLE `crimes` (
  2.   `crimeID` int(11) NOT NULL auto_increment,
  3.   `crimeNAME` varchar(255) NOT NULL default '',
  4.  
  5.   `crimeBRAVE` int(11) NOT NULL default '0',
  6.   `crimePERCFORM` text NOT NULL,
  7.   `crimeSUCCESSMUNY` int(11) NOT NULL default '0',
  8.   `crimeSUCCESSCRYS` int(11) NOT NULL default '0',
  9.  
  10.   `crimeSUCCESSITEM` int(11) NOT NULL default '0',
  11.   `crimeGROUP` int(11) NOT NULL default '0',
  12.   `crimeITEXT` int(11) NOT NULL default '0',
  13.   `crimeSTEXT` int(11) NOT NULL default '0',
  14.   `crimeFTEXT` int(11) NOT NULL default '0',
  15.  
  16.   `crimeJTEXT` int(11) NOT NULL default '0',
  17.   `crimeJAILTIME` int(10) NOT NULL default '0',
  18.   `crimeJREASON` varchar(255) NOT NULL default '0',
  19.   `crimeXP` int(11) NOT NULL default '0',
  20.  
  21.   PRIMARY KEY  (`crimeID`)
  22. ) ENGINE=MyISAM  ;
errors i get on page using
Expand|Select|Wrap|Line Numbers
  1. <?php 
  2. error_reporting(E_ALL); 
  3. ini_set('display_errors', true);
Expand|Select|Wrap|Line Numbers
  1. Notice: Undefined index: HTTP_X_FORWARDED_FOR in /home/reddr431/public_html/smoke/header.php on line 111
  2.  
  3. Notice: Undefined index: attacking in /home/reddr431/public_html/smoke/header.php on line 120
  4.  
full code for this is attached below
been trying to fix this for a few weeks now
Attached Files
File Type: txt crimes.php.txt (13.0 KB, 929 views)
Apr 14 '10 #1
9 2267
maybe the error is related to the type.Could be you are passing a integer or a string where MySQL is expecting the other type.
Apr 14 '10 #2
@guillermobytes
nope tryed changeing it around been looking alot of forums but still no answer
Apr 14 '10 #3
sorry i didn't look at the code, now i see the error, it's the VALUE of crimeSUCCESSCRYS that is not set in the query values.
It may be related to the missing index "attacking" on line 120 in /home/reddr431/public_html/smoke/header.php
Apr 14 '10 #4
@guillermobytes
crimeSUCCESSCRYS` int(11) NOT NULL default '0',
Apr 14 '10 #5
the problem is not the table, its the query
Expand|Select|Wrap|Line Numbers
  1. Query was INSERT INTO crimes (crimeNAME, crimeBRAVE, crimePERCFORM, crimeSUCCESSMUNY, crimeSUCCESSCRYS, crimeSUCCESSITEM, crimeGROUP, crimeITEXT, crimeSTEXT, crimeFTEXT, crimeJTEXT, crimeJAILTIME, crimeJREASON, crimeXP) VALUES( 'fdfdf', '1', '((WILL*0.8)/2.5)+(LEVEL/4)', '12', MISSING_VALUE, 0, '1', '2121221', '1212121', '12121', '12121', 1211, '121', 121)
you have no value in crimeSUCCESSCRYS
see where i put MISSING_VALUE
Apr 14 '10 #6
ok done the input again with missing value and still have the error
Expand|Select|Wrap|Line Numbers
  1. QUERY ERROR:
  2. Query was INSERT INTO 'crimes' ('crimeNAME', 'crimeBRAVE', 'crimePERCFORM', 'crimeSUCCESSMUNY', 'crimeSUCCESSCRYS', 'crimeSUCCESSITEM', 'crimeGROUP', 'crimeITEXT', 'crimeSTEXT', 'crimeFTEXT', 'crimeJTEXT', 'crimeJAILTIME', 'crimeJREASON', 'crimeXP') VALUES( 'name', '1', '((WILL*0.8)/2.5)+(LEVEL/4)', '12', 0, 0, '1', 'intal text', 'success text', 'failure', 'jail', 12, 'reason', 12)
Apr 14 '10 #7
Dormilich
8,658 Expert Mod 8TB
maybe it’s because you want to pass a string to an integer field?
Apr 14 '10 #8
@Dormilich
problem fixed it was a simple code error

this
Expand|Select|Wrap|Line Numbers
  1. INSERT INTO crimes 
should have been
Expand|Select|Wrap|Line Numbers
  1. INSERT INTO .crimes 
i was missing a '.' from the code all works now thanks for your help guys
Apr 15 '10 #9
@icemaster451
wow i have never seen that, plus the error output wasn't redirecting to this part of the code. wierd but glad you solved it
Apr 16 '10 #10

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

Similar topics

1
by: Steve | last post by:
I just spent waaaaaaaaaaaayy too much time trying to track down an error that was incorrectly reported just now, and I would like to see if someone can explain to me why it was reported that way. ...
0
by: Morten Gulbrandsen | last post by:
C:\mysql\bin>mysql -u elmasri -pnavathe company Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 29 to server version: 4.1.0-alpha-max-debug Type...
3
by: tshad | last post by:
If you get an exception or SqlException, how do you get the actual message? Not the detailed breakdown, but the actual message. For example, in the following message, I would like to find just...
8
by: Uros | last post by:
Hello! I have problem with my function and I can find what's wrong. WARNING: Error occurred while executing PL/pgSQL function fn_insert_entry_pending WARNING: line 26 at SQL statement...
5
by: r.nikhilk | last post by:
Hi, Currently, we are porting C++ applications from 32 bit to 64 bit on AIX platform. (The current version of AIX is 5.3 and xlC verison is 8.0). We are able to compile the applications by...
1
by: beary | last post by:
Could someone please tell me what's wrong with the code below. It worked fine the first time, then I cleared the table (results) and tried it again, but got the message "You have an error in your SQL...
0
by: moishyyehuda | last post by:
whey when I execute this statment cursor.execute("""mysqlimport merchandise 1.txt""") I get this error ProgrammingError: (1064, "You have an error in your SQL syntax. Check the manual that...
3
by: Trez | last post by:
Hey guys, Am new at using ASP.Net. am having some problems updating my SQL DB. whenever i try i get this Error. Can someone help me? Incorrect syntax near 'nvarchar'. Description: An unhandled...
1
by: ajos | last post by:
hi evrybdy, the problem is:- i had this running before in jsp but when i changed the jsp page using struts tags there occoured a problem... when i enter values in the 2 text boxes and click enter...
10
by: bobf | last post by:
I am using a program 'My Contact Table' which is a code generator program. It allows you to easily create a PHP/MySQL web application without writing any code. I am trying to create an additional...
0
BarryA
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...
1
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...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.