Hi, I have mysql 5.045 installed on my server and i've written a code to insert values into the database. it keeps coming up with this error
Error in query: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 's within 7 working days of receipt, if the item is not as described.
', ' at line 66
there is nothing wrong with the coding as it's been used and tested on other servers and works perfectly fine....i don't understand why this error is showing. My code is below -
<?PHP error_reporting(E_ALL);
-
$username="tempsUser";
-
$password="auction";
-
$database="auctionTemps";
-
-
-
$htmlcss=$_POST['htmlcss'];
-
$header=$_POST['header'];
-
$nav=$_POST['nav'];
-
$titleWrap01=$_POST['titleWrap01'];
-
$title=$_POST['title'];
-
$titleWrap02=$_POST['titleWrap02'];
-
$subheadWrap01=$_POST['subheadWrap01'];
-
$subheading=$_POST['subheading'];
-
$subheadWrap02=$_POST['subheadWrap02'];
-
$flashWrap01=$_POST['flashWrap01'];
-
$flashWrap02=$_POST['flashWrap02'];
-
$flash01=$_POST['flash01'];
-
$flashVar=$_POST['flashVar'];
-
$flash02=$_POST['flash02'];
-
$flashWrap03=$_POST['flashWrap03'];
-
$descriptionWrap01=$_POST['descriptionWrap01'];
-
$description=$_POST['description'];
-
$descriptionWrap02=$_POST['descriptionWrap02'];
-
$generalWrap01=$_POST['generalWrap01'];
-
$general=$_POST['general'];
-
$generalWrap02=$_POST['generalWrap02'];
-
$aboutWrap01=$_POST['aboutWrap01'];
-
$about=$_POST['about'];
-
$aboutWrap02=$_POST['aboutWrap02'];
-
$paymentWrap01=$_POST['paymentWrap01'];
-
$payment01=$_POST['payment01'];
-
$payment02=$_POST['payment02'];
-
$paymentWrap02=$_POST['paymentWrap02'];
-
$termsWrap01=$_POST['termsWrap01'];
-
$terms=$_POST['terms'];
-
$termsWrap02=$_POST['termsWrap02'];
-
$footer=$_POST['footer'];
-
-
-
// OPEN CONNECTION --->
-
$connection=mysql_connect("localhost","$username", "$password") or die("Unable to connect!");
-
-
mysql_select_db("$database") or die("Unable to select database!");
-
-
-
// EXECUTE QUERY --->
-
$query="INSERT templates (
-
-
htmlcss,
-
header,
-
nav,
-
titleWrap01,
-
title,
-
titleWrap02,
-
subheadWrap01,
-
subheading,
-
subheadWrap02,
-
flashWrap01,
-
flashWrap02,
-
flash01,
-
flashVar,
-
flash02,
-
flashWrap03,
-
descriptionWrap01,
-
description,
-
descriptionWrap02,
-
generalWrap01,
-
general,
-
generalWrap02,
-
aboutWrap01,
-
about,
-
aboutWrap02,
-
paymentWrap01,
-
payment01,
-
payment02,
-
paymentWrap02,
-
termsWrap01,
-
terms,
-
termsWrap02,
-
footer)
-
-
VALUES(
-
'".$htmlcss."',
-
'".$header."',
-
'".$nav."',
-
'".$titleWrap01."',
-
'".$title."',
-
'".$titleWrap02."',
-
'".$subheadWrap01."',
-
'".$subheading."',
-
'".$subheadWrap02."',
-
'".$flashWrap01."',
-
'".$flashWrap02."',
-
'".$flash01."',
-
'".$flashVar."',
-
'".$flash02."',
-
'".$flashWrap03."',
-
'".$descriptionWrap01."',
-
'".$description."',
-
'".$descriptionWrap02."',
-
'".$generalWrap01."',
-
'".$general."',
-
'".$generalWrap02."',
-
'".$aboutWrap01."',
-
'".$about."',
-
'".$aboutWrap02."',
-
'".$paymentWrap01."',
-
'".$payment01."',
-
'".$payment02."',
-
'".$paymentWrap02."',
-
'".$termsWrap01."',
-
'".$terms."',
-
'".$termsWrap02."',
-
'".$footer."')";
-
-
//////----->
-
$result=mysql_query($query) or die("Error in query:".mysql_error());
-
//if ($result)
-
//echo mysql_affected_rows()." row inserted into the database effectively.";
-
-
// CLOSE CONNECTION --->
-
mysql_close($connection);
-
-
///////////////////////////////////////////////////////////////////////////////////
-
-
?>
-
-
4 1392
If your variable string that is being stored (the one with "...within 7 working days of receipt...") has any single quotes ( ' ) it will stop the code and cause errors.
Also, I am pretty sure you don't need:
But:
Or:
will be fine. I prefer the second option.
No worries. Glad I could help.
Sign in to post your reply or Sign up for a free account.
Similar topics
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.
...
|
by: Donald Canton |
last post by:
Hi,
I'm using Bjarne's book to learn C++ and am stuck on the Calc program
in Section 6. Everything works fine except when I try to use
istringstream to parse a token from the command line. I...
|
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...
|
by: david |
last post by:
Anyone could give me a hand about this syntax error? Thank you.
David
Source Code:
Dim conn As New SqlConnection(strConn)
Dim daAngio As New SqlDataAdapter(strSelectStatement, conn)
'Create a...
|
by: Manuel |
last post by:
I'm trying to compile glut 3.7.6 (dowbloaded from official site)using
devc++.
So I've imported the glut32.dsp into devc++, included manually some
headers, and start to compile.
It return a very...
|
by: Hari Sekhon |
last post by:
I've written an except hook into a script as shown below which works
well for the most part and catches exceptions.
import sys
def myexcepthook(type,value,tb):
do something
...
|
by: Josh |
last post by:
I have a lot of except Exception, e statements in my code, which poses some
problems. One of the biggest is whenever I refactor even the triviallest
thing in my code.
I would like python to...
|
by: bryant |
last post by:
Hi all.
I am new to ASP and working in Expression Web. The following query
displays the information I need in the gridview for a single record.
SELECT "OE_HDR"."ORD_NO", "OE_HDR"."CUST_NAM",...
|
by: muby |
last post by:
Hi everybody :)
I'm modifying a C++ code in VC++ 2005
my code snippet
void BandwidthAllocationScheduler::insert(
Message* msg,
BOOL* QueueIsFull,
|
by: Banfa |
last post by:
So I have a little problem, I have a template class and that class contains a template function; now what I want to do is declare that function in the class (or indeed the entire class) as a friend...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
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: 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...
|
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,...
|
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...
|
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...
|
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...
| |