I'm newbie and I had a problem on my SQL syntax like this 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 '=1WHERE id_poll='1'' at line 1
The following below is my php code -
<?php
-
include "inc.koneksi.php";
-
$IdDataH =$_POST['IdDataH'];
-
$Rbpilih =$_POST['Rbpilih'];
-
-
$poll_sql ="SELECT * FROM polling WHERE id_poll='$IdDataH'";
-
$poll_qry =mysql_query($poll_sql, $konek)
-
or die ("Gagal menampilkan".mysql_error());
-
-
$poll_data =mysql_fetch_array($poll_qry);
-
-
switch ($Rbpilih){
-
default :
-
$hasil=$poll_data['hasil_a']+1;
-
$jawab="hasil_a=$hasil";
-
break;
-
case 'a' :
-
$hasil=$poll_data['hasil_a']+1;
-
$jawab="hasil_a=$hasil";
-
break;
-
case 'b' :
-
$hasil=$poll_data['hasil_b']+1;
-
$jawab="hasil_b=$hasil";
-
break;
-
case 'c' :
-
$hasil=$poll_data['hasil_c']+1;
-
$jawab="hasil_c=$hasil";
-
break;
-
}
-
-
$poll_sql2 ="UPDATE polling SET".$jawab."WHERE id_poll='$IdDataH'";
-
-
$poll_qry2 =mysql_query($poll_sql2, $konek)
-
or die ("Gagal menampilkan".mysql_error());
-
-
include "index.html";
-
?>
-
can anyone have a solution about this problem ?
3 2321
Line 31, insert a space after the SET and before the WHERE, would be my guess.
've tried as your suggestion but still can not.
please tell me what I should do anymore ?
Dormilich 8,658
Recognized Expert Moderator Expert
post the new error message. the mentioned missing space was clearly the one causing this error.
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Sandesh |
last post by:
Hello All,
Me saying " has any body come across such error would be
underestimating".
Well I am getting a very peculiar and unique error "Line 1: Incorrect
syntax near 'Actions'."
Explaining you the scene is the following Stored Proc.
|
by: martin1 |
last post by:
I just use DataSet to bind DataSetGrid and display from SQL DB.
when starting run in Visual Studio 2005, get "Line 1: Incorrect syntax near
'1'" error message from below fill line,
objDataAdapter.Fill(objDataSet, "mindata")
any help is greatly appriciated.
|
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
...
|
by: iporter |
last post by:
In the following code, the two Response.Write statements output exactly
the same - I can copy and paste both into Query Analyzer, and run them
fine. However, if I comment out line 3, the assignment of "SELECT
T..." to the variable query, the last line produces the error:
Line 1: Incorrect syntax near '<'.
Many thanks in advance for any explanation - the problem is tearing my
hair out!!
Iain
|
by: Dax |
last post by:
When i insert some values float in a form made with ASP
appear an error message like this:
Microsoft OLE DB Provider for SQL Server (0x80040E14)
Line 1: Incorrect syntax near ','.
sql="select id from tbl_monete where id_taglio="&idtaglio
rs1.open sql, conn
idTaglio it's the value of money that can be like 0,5 0,2,
0,1 etc etc
| |
by: arial |
last post by:
Hi,
I am getting this error message:
Incorrect syntax near the keyword 'where'.
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 near the keyword 'where'.
Source Error:
|
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...
|
by: karenkksh |
last post by:
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 near the keyword 'user'.
Source Error:
Line 35: MyAdapter1 = new SqlDataAdapter(MyCommand1);
Line 36: MyDataSet1 = new DataSet();
Line 37: ...
|
by: icemaster451 |
last post by:
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
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
Query was INSERT INTO crimes (crimeNAME,...
|
by: Omendra |
last post by:
Hi, I am using SQL Server 2005 and i am using Stored Procedure something like :-
I am getting error:-
Msg 170, Level 15, State 1,
Line 18: Incorrect syntax near 'MAX'.
DECLARE @jid AS VARCHAR(20),
@DBName As VARCHAR(50),
@Query AS VARCHAR(MAX)
|
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
| |
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,...
|
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
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...
|
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...
|
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...
|
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...
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
|
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |