473,946 Members | 8,812 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

5 New Member
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, 936 views)
Apr 14 '10 #1
9 2308
guillermobytes
77 New Member
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
icemaster451
5 New Member
@guillermobytes
nope tryed changeing it around been looking alot of forums but still no answer
Apr 14 '10 #3
guillermobytes
77 New Member
sorry i didn't look at the code, now i see the error, it's the VALUE of crimeSUCCESSCRY S 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
icemaster451
5 New Member
@guillermobytes
crimeSUCCESSCRY S` int(11) NOT NULL default '0',
Apr 14 '10 #5
guillermobytes
77 New Member
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 crimeSUCCESSCRY S
see where i put MISSING_VALUE
Apr 14 '10 #6
icemaster451
5 New Member
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 Recognized Expert Moderator Expert
maybe it’s because you want to pass a string to an integer field?
Apr 14 '10 #8
icemaster451
5 New Member
@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
guillermobytes
77 New Member
@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
3369
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. The purpose of the code is simply to delete a record and then redirect back to the page where the delete was started. The code looks like this: elseif ($_GET == "delete") { $query = "delete from product_subcategory2 where product_sku=$_GET and...
0
1193
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 'help;' or '\h' for help. Type '\c' to clear the buffer. mysql> select database(); +------------+ | database() | +------------+
3
511
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 "Incorrect syntax near the keyword 'and'." or "System.Data.SqlClient.SqlException: Incorrect syntax near the keyword 'and'." instead of:
8
3785
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 ERROR: parser: parse error at or near "$1" at character 58 create or replace function "fn_insert_entry_pending"(varchar,varchar,varchar,varchar,varchar,boolean,boolean,date,int,int) returns integer as ' declare
5
4539
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 including the -q64 option in xlC compiler. And we are able to link all these libraries to one of the main applications and generate an executable. SKLoader. But, when we try to run this main executable, we are getting the following errors:
1
1459
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 syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1". Problem is I can't see any " near line. And it worked fine the first time. What am I missing? Thankyou. <?php ...
0
1148
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 corresponds to your MySQL server version for the right syntax to use near 'mysqlimport merchandise 1.txt' at line 1") args = (1064, "You have an error in your SQL syntax. Check the...se near 'mysqlimport merchandise 1.txt' at line 1")
3
1894
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 exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.Data.SqlClient.SqlException: Incorrect syntax...
1
3385
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 an exception occours which is- type Exception report message description The server encountered an internal error () that prevented it from fulfilling this request.
10
50051
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 data entry page. I have copied an existing page and created a new table in my database. When I run the script I get the error message "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right...
0
9974
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
11140
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
11320
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9872
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
8240
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
7402
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
6095
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
6317
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4928
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.