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

Special characters like " ' "

I have a big problems because I have to query a database which
contents contains some - ' - characters and obviously the query back
with errors.

An example is in www.queenarena.com/turbol.php

When the name are without those characters everything goes well but I
cant menage the other one.

I need to let the query see those characters in a different way.

I cant modify those chars because are too many ( more than 1000
entries )
Thanks in advance
rudy

www.queenarena.com
the QUEEN portal
Jul 17 '05 #1
2 1995
QueenArenA.com <we************@queenarena.com> wrote:
I have a big problems because I have to query a database which
contents contains some - ' - characters and obviously the query back
with errors.

An example is in www.queenarena.com/turbol.php

When the name are without those characters everything goes well but I
cant menage the other one.

I need to let the query see those characters in a different way.


if $query contains your sql statement, try
$query = mysql_escape_string($query);
or
$query = mysql_escape_string(stripslashes($query));
if you also want to get rid of preceding \ characters.
after this,
mysql_query($query);
Jul 17 '05 #2


"QueenArenA.com" wrote:

I have a big problems because I have to query a database which
contents contains some - ' - characters and obviously the query back
with errors.

An example is in www.queenarena.com/turbol.php

When the name are without those characters everything goes well but I
cant menage the other one.

I need to let the query see those characters in a different way.

I cant modify those chars because are too many ( more than 1000
entries )


Search php.net for stripslashes() and urlencode() functions.

Regards,
Shawn
--
Shawn Wilson
sh***@glassgiant.com
http://www.glassgiant.com
Jul 17 '05 #3

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

Similar topics

12
by: Mosher | last post by:
Hi all, I have an issue with php and/or mysql. I have a php form that writes "items" to a mysql database, including a description of the item. On the mysql server, "magic_quotes_gpc" is ON. I...
14
by: tertius | last post by:
Is there a better way to append certain chars in a string with a backslash that the example below? chr = "#$%^&_{}" # special chars to look out for str = "123 45^ & 00 0_" # string to...
1
by: Christian Schmidbauer | last post by:
Hello! I prepare my XML document like this way: ------------------------------------------------------- PrintWriter writer; Document domDocument; Element domElement; // Root tag
8
by: Frank Ratzlow | last post by:
Hi folks, I have a list of entries where some entries contain the special character (quotes) within in the string. If I try to save this entry everything after the quotes is skipped. The reason...
1
by: Nergock | last post by:
Hi, Does anyone know how to handle special characters like "<" and ">" in the web.config file? Something like this would cause my app to not startup. <add key="SenderEmail" value="John Doe...
2
by: Diilb | last post by:
I am using DOM to create an rss feed. The problem I am running into is "special characters" such as é è ç. If I try adding them to the XML as character data (CData), DOM chokes and throws out...
3
KevinADC
by: KevinADC | last post by:
Purpose The purpose of this article is to discuss the difference between characters inside a character class and outside a character class and some special characters inside a character class....
3
by: veer | last post by:
Hi i want to make a program on searching which works fine but when the special characters came like "ö, ä it is not seaching these characters please give some idea reGArds varinder
2
by: Martin Honnen | last post by:
John Straumann wrote: Ask the author of the file how it is encoded. Then use that encoding to read the file. For instance if it is UTF-8 encoded then use new StreamReader("file.txt",...
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...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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...
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...

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.