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

Writing bzcompressed data into SQL-DB?

Hi,

when compressing strings with bzcompress, I have the problem that the
result apparently often contains 'letters' that mess up sql statements.

Of course I can urlencode the string, but that wont keep it as small.
What would be the best way to send a bzcompressed string to a SQL
statement? is it possible at all without urlencode?

thanks

Oliver

Jul 17 '05 #1
4 1558
On Sat, 21 Aug 2004 08:46:44 GMT, Oliver Spiesshofer <ol****@email.com> wrote:
when compressing strings with bzcompress, I have the problem that the
result apparently often contains 'letters' that mess up sql statements.

Of course I can urlencode the string, but that wont keep it as small.
What would be the best way to send a bzcompressed string to a SQL
statement? is it possible at all without urlencode?


The best way depends on which database you are using. Which one is it?

--
Andy Hassall / <an**@andyh.co.uk> / <http://www.andyh.co.uk>
<http://www.andyhsoftware.co.uk/space> Space: disk usage analysis tool
Jul 17 '05 #2
Oliver Spiesshofer wrote:
Hi,

when compressing strings with bzcompress, I have the problem that the
result apparently often contains 'letters' that mess up sql statements.

Of course I can urlencode the string, but that wont keep it as small.
What would be the best way to send a bzcompressed string to a SQL
statement? is it possible at all without urlencode?

thanks

Oliver


Unless it is a password where the data is short enough or the data is NEVER used
in a select statement (using LIKE '%some text%' I would advise to NOT compress
the data. REtreiving the data or selecting on the data will cause a performance
hit you may not want to experience.

As long as the data is enclosed in single-quotes and you can guarantee that the
compressed data won't use single-qoutes, then you shouldn't have any problem.
If you urlencode your data you have another degree of obfuscation that will
translate into performance degradation.

Writing a web app based on testing one single connection is a problem waiting to
happen. Don't code with the mis-conception that if it works for one query it
will work for thousands per hour...

--
Michael Austin.
Consultant - Not Available.
Donations still welcomed. Http://www.firstdbasource.com/donations.html
:)
Jul 17 '05 #3
Andy Hassall <an**@andyh.co.uk> wrote in
news:mj********************************@4ax.com:
The best way depends on which database you are using. Which one is
it?


sorry,

its MySQL

Jul 17 '05 #4
On Sat, 21 Aug 2004 15:02:09 GMT, Oliver Spiesshofer <ol****@email.com> wrote:
Andy Hassall <an**@andyh.co.uk> wrote in
news:mj********************************@4ax.com :
The best way depends on which database you are using. Which one is
it?


sorry,

its MySQL


In that case it's the same as any other data you put into MySQL - run it
exactly once through addslashes() (or the practically equivalent
mysql_escape_string()).

--
Andy Hassall / <an**@andyh.co.uk> / <http://www.andyh.co.uk>
<http://www.andyhsoftware.co.uk/space> Space: disk usage analysis tool
Jul 17 '05 #5

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

Similar topics

0
by: Mzkhan | last post by:
Hi , Here is the situation: I am creating a web page from a perl script.. this web page has checkboxes which are from an oracle table - From this page I am creating sql query and passing the...
1
by: Barnes | last post by:
I have an asp form that sends data to a redirect page with SQL using JScript. There is a function that I'm using called replace(). The form submits without errors and goes to the redirect page but...
4
by: Simon | last post by:
Hi all, I have a process, where I take a dataset from an SQL call, and need to write an XML file from that dataset. The data set can contain 10's of tables, each with 100's of rows, and I have...
13
by: Jeff Pritchard | last post by:
I have an MDB that contains a single table. Checkweigher data is being continuously written to this MDB from a dedicated workstation over a network into the MDB on the server at the rate of about...
8
by: Paul | last post by:
I have an application that I am tryign to modify, I never wrote the original so need help with my modifications. Currently the app reads and writes to an Access database with one table 'pupils'...
12
by: Chris Springer | last post by:
I'd like to get some feedback on the issue of storing data out to disk and where to store it. I've never been in a production environment in programming so you'll have to bear with me... My...
5
by: UJ | last post by:
I have a system that has five programs that all communicate with each other via Message Queues. Works well. One program is a watchdog that will make sure the others are up and going. Currently I...
3
by: JJ297 | last post by:
Hello I'm a newbie to programming and need help writing an if statement. I have a database set up in SQL with the following fields: Category Questions Answers I only want one...
3
by: Thorben Grosser | last post by:
Hello Newsgroup, I am doing some archive database and therefore got one table indexing every folder and one table storing which rack belongs to which department, eg: table folders :...
1
by: Gilles Ganault | last post by:
Hello There's not much activity in the Lighttpd forum, so I figured maybe some people here use this web server instead of Apache, and would know the cause of the problem. PHP scripts can...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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?
0
marktang
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,...
0
jinu1996
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...
0
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...
0
tracyyun
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...
0
agi2029
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,...
0
isladogs
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...

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.