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

quote escaping for MySQL statement

I'm doing a data migration and used gnumeric to change some big
spreadsheets into .csv files for upload into a MySQL database through php.

It seems to have done fine on my local machine, but it is dying on the
production dB when it encounters a single
quote, e.g. "The Manufacturer's specification ..."
Right there------------------^

magicquotes is On
Is there a handy extra function that can improves a string's chances of
getting into MySQL cleanly?

The setting for the csv export was "Always" (escape-quote everything)

Jul 17 '05 #1
6 3501
Found this fxn and am trying it out. All advice/stories of your
experiences are appreciated
Jul 17 '05 #2
mysql_escape_string($sting); ?

Maybe i'm wrong, because i'm a noob,
in that case, my apologies.

Jul 17 '05 #3
According to PHP docs:

"Note: This function has been deprecated since PHP 4.3.0. Do not use
this function. Use mysql_real_escape_string() instead. "

http://ve.php.net/manual/en/function...ape-string.php

Jul 17 '05 #4
According to PHP docs:

"Note: This function has been deprecated since PHP 4.3.0. Do not use
this function. Use mysql_real_escape_string() instead. "

http://ve.php.net/manual/en/function...ape-string.php

Jul 17 '05 #5
Well, i've got a lttle problem with that:
When i base queries upon parameters in the url,
i use mysql_escape_string(), becaus real_escape
gives me an error.

When i run a script to load some data into the DB,
(all serverside) i CAN use mysql_real_escape_string()
without an error.

Any clue?

Jul 17 '05 #6
.oO(knoak)
Well, i've got a lttle problem with that:
When i base queries upon parameters in the url,
i use mysql_escape_string(), becaus real_escape
gives me an error.


What error?

Micha
Jul 17 '05 #7

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

Similar topics

1
by: leegold2 | last post by:
// This statement below inserting one field works: // mysql_query("INSERT INTO page (page_url) VALUES (\"$url_field\")"); But I wanted to insert into two fields so I was trying all sorts of...
4
by: Tom Chadwin | last post by:
Hello all Using PHP 4.1.2, I am seeing intermittent visible escaping backslashes in my HTML output. Try refreshing the following page a few times to see what I mean: ...
11
by: Dave Smithz | last post by:
Having adopted someone else's PHP cope and completing a crash course in the language I came across a (probably common) problem with the current code. On a registration form, whenever users names...
14
by: Ian Rastall | last post by:
Sorry for the double question. I'm having a terrible time figuring out how to escape apostrophes in my mySQL database. Perhaps they have to be escaped in the PHP, using mysql_real_escape_string? ...
0
by: Mike Chirico | last post by:
Interesting Things to Know about MySQL Mike Chirico (mchirico@users.sourceforge.net) Copyright (GPU Free Documentation License) 2004 Last Updated: Mon Jun 7 10:37:28 EDT 2004 The latest...
4
by: agarwalpiyush | last post by:
Hello, I am going nuts with trying to get the following to work: This is what I intend to do: I have a line in /etc/syslog.conf which I need to delete based on ip-address provided to me in a...
3
by: Regan | last post by:
Hello, I have done tons of searching on this topic but have yet to find something relavent to the problem I am experiencing so I am hoping someone can help me. The problem I am having is that...
9
by: davek | last post by:
(posted to: php.general, comp.lang.php, alt.php, alt.php.sql) I have a form where registered users on my site can edit their login details. For some reason, the script is inserting an extraneous...
9
by: D1R | last post by:
I have to migrate a web application written in PHP and I am using PHP 5.2.6 ISAPI. The problem I have is related to some sql queries that have the following format: $sql = "insert into...
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
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: 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...
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
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...
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.