473,326 Members | 2,133 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,326 software developers and data experts.

what's wrong?


insert into canton ( big5, thekey, changjei, canton, touched ) values ('
µ\\','BAY ','MGPP ','PEI ',0)

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 'BAY
','MGPP

'µ\\' is mysql_real_escape_string('µ\')

--
iTech Consulting Co., Ltd.
Expert of ePOS solutions
Website: http://www.itech.com.hk (IE only)
Tel: (852)2325 3883 Fax: (852)2325 8288
Mar 16 '07 #1
6 1162
Man-wai Chang wrote:
insert into canton ( big5, thekey, changjei, canton, touched ) values ('
µ\\','BAY ','MGPP ','PEI ',0)

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 'BAY
','MGPP

'µ\\' is mysql_real_escape_string('µ\')
'µ\\' is strange! Did you try replacing it by anything else? \' May not
be seen as the end of the string. There would be a string " µ\',"
followed by BAY...

FUp2: comp.databases.mysql

Heiko
--
http://portal.richler.de/ Namensportal zu Richler
http://www.richler.de/ Heiko Richler: Computer - Know How!
http://www.richler.info/ private Homepage
Mar 16 '07 #2
insert into canton ( big5, thekey, changjei, canton, touched ) values ('
µ\\','BAY ','MGPP ','PEI ',0)

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 'BAY
','MGPP

'µ\\' is mysql_real_escape_string('µ\')
The sql is failling because you have opened the quotes and not closed them
before the bay input (you have used an escape character before the closing
quote.
Mar 16 '07 #3
peter wrote:
>insert into canton ( big5, thekey, changjei, canton, touched ) values ('
µ\\','BAY ','MGPP ','PEI ',0)

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 'BAY
','MGPP

'µ\\' is mysql_real_escape_string('µ\')

The sql is failling because you have opened the quotes and not closed them
before the bay input (you have used an escape character before the closing
quote.

That would give a PHP syntax error. He's getting a MySQL error.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Mar 16 '07 #4
Man-wai Chang wrote:
insert into canton ( big5, thekey, changjei, canton, touched ) values ('
µ\\','BAY ','MGPP ','PEI ',0)

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 'BAY
','MGPP

'µ\\' is mysql_real_escape_string('µ\')
Interesting. What is your table definition and what charset are you
using? Also, what is the hex value of 'µ\'?

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Mar 16 '07 #5
That would give a PHP syntax error. He's getting a MySQL error.
If for example in the php code he has the following:-

$sql = "insert into canton ( big5, thekey, changjei, canton, touched )
values ('\','BAY ','MGPP ','PEI ',0)"

then no it will not create a php parse error it will have an sql error like
he has as \' is an escaped single quotation mark thus the closing quotation
mark is the 1 directly before BAY
Mar 16 '07 #6
peter wrote:
>That would give a PHP syntax error. He's getting a MySQL error.

If for example in the php code he has the following:-

$sql = "insert into canton ( big5, thekey, changjei, canton, touched )
values ('\','BAY ','MGPP ','PEI ',0)"

then no it will not create a php parse error it will have an sql error like
he has as \' is an escaped single quotation mark thus the closing quotation
mark is the 1 directly before BAY

That's true if the entire string is includes in double quotes. But that
isn't at all clear in the original statement. But you're probably right.

One fact remains - mysql_real_escape_string should be taking care of this.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Mar 16 '07 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

125
by: Sarah Tanembaum | last post by:
Beside its an opensource and supported by community, what's the fundamental differences between PostgreSQL and those high-price commercial database (and some are bloated such as Oracle) from...
5
by: titan0111 | last post by:
#include<iostream> #include<iomanip> #include<cstring> #include<fstream> using namespace std; class snowfall { private: int ft;
72
by: E. Robert Tisdale | last post by:
What makes a good C/C++ programmer? Would you be surprised if I told you that it has almost nothing to do with your knowledge of C or C++? There isn't much difference in productivity, for...
121
by: typingcat | last post by:
First of all, I'm an Asian and I need to input Japanese, Korean and so on. I've tried many PHP IDEs today, but almost non of them supported Unicode (UTF-8) file. I've found that the only Unicode...
28
by: Madhur | last post by:
Hello what about this nice way to open a file in single line rather than using if and else. #include<stdio.h> void main() { FILE *nd; clrscr();...
56
by: Cherrish Vaidiyan | last post by:
Frinds, Hope everyone is doing fine.i feel pointers to be the most toughest part in C. i have just completed learning pointers & arrays related portions. I need to attend technical interview on...
46
by: Keith K | last post by:
Having developed with VB since 1992, I am now VERY interested in C#. I've written several applications with C# and I do enjoy the language. What C# Needs: There are a few things that I do...
13
by: Jason Huang | last post by:
Hi, Would someone explain the following coding more detail for me? What's the ( ) for? CurrentText = (TextBox)e.Item.Cells.Controls; Thanks. Jason
9
by: Pyenos | last post by:
import cPickle, shelve could someone tell me what things are wrong with my code? class progress: PROGRESS_TABLE_ACTIONS= DEFAULT_PROGRESS_DATA_FILE="progress_data" PROGRESS_OUTCOMES=
3
by: Siong.Ong | last post by:
Dear all, my PHP aims to update a MySQL database by selecting record one by one and modify then save. Here are my PHP, but I found that it doesnt work as it supposed to be, for example, when...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
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...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

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.