Multi-Table UPDATE Emulation

2003-12-08 Thread Mike Brum
Hopefully someone can help me out with this - 

I have two tables in mySQL: comments and diary

I want to populate a new field in comments with the current values of diary
- but only if they meet certain criteria.

Now, the problem is this - my webserver is using an older version of mySQL
that doesn't support UPDATEs from multiple tables (that's not possible until
v4.0.4) and unfortunately, them updating the install isn't a possibility. I
know if it was v4.0.4+ I could juse use:

UPDATE comments,diary
SET comments.diary_date=diary.date
WHERE comments.refid=diary.ID

I also don't think I can use sub-selects in queries either. 

Btw - I'm currently running v3.23.58.

Thanks for any help!

-M


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



RE: Security Question

2003-11-26 Thread Mike Brum
One of the first things that I did at my former job was to turn off all
external-facing network adapters to our DB machines. If you're fortunate
enough that your DB resides on it's own box and not the webserver itself,
then there's really no reason that you *need* to have it externally facing.
There are PLENTY of solutions that you can put in place in order to still
have remote access to those machines without them having an externally
routable IP.

While it is possible for a hacker to compromise one machine and then access
the DB machine over your internal WAN at the hosting location, the more
roadblocks you put between a potential hacker and your sensitive data, the
better.

-M


-Original Message-
From: Curley, Thomas [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, November 26, 2003 8:22 AM
To: [EMAIL PROTECTED]
Subject: RE: Security Question
Importance: High


thanks for reply - the requirement comes from a security audit - so try to
think in terms of a hacker

Obviously and (I had assumed)
1.  - the files would have tight unix security file permissions applied
2.  - indeed the key would be stored on an internal tightly managed box
(or device)

Another Assumption
--
Encrypting / decrypting all data on the fly would be too expensive and grind
the app to a halt

So the question again :-

Any ideas on how to avoid having data files stored with absolutely
no protection against copying 


If there is no solution to this then MySql should not be used on internet
accessible boxes for dynamic web sites


Thomas






-Original Message-
From: Fagyal, Csongor [mailto:[EMAIL PROTECTED]
Sent: 26 November 2003 12:51
To: Curley, Thomas
Cc: [EMAIL PROTECTED]
Subject: Re: Security Question


Thomas,

I am trying to find a solution to the following security issue with 
MySql DB on linux

- Someone copies the DB files to another box, starts a mysql instance, 
loads the DB and presto - views the 'private' data !!!
  

Well, someone should not have access rights to the DB files on the 
first hand.

Ideally I would like to know if there is any option in MySql to store 
the DB files in a secure format and one that needs a key or similiar to
open the DB
  

If someone was able to access your DB files, he would probably also be 
able to access that key (that you must store _somewhere_), wouldn't he?

- Csongor



*
This email and any attachments are confidential and intended for the sole
use of the intended recipient(s).If you receive this email in error please
notify [EMAIL PROTECTED] and delete it from your system. Any
unauthorized dissemination, retransmission, or copying of this email and any
attachments is prohibited. Euroconex does not accept any responsibility for
any breach of confidence, which may arise from the use of email. Please note
that any views or opinions presented in this email are solely those of the
author and do not necessarily represent those of the Company. This message
has been scanned for known computer viruses. 

*

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



RE: how to limit COUNT(*)

2003-07-22 Thread Mike Brum
Would that help at all - since the COUNT(*) would execute fully and then
MAX would limit it? (or is the order of operations different than that?)

-M

-Original Message-
From: Yves Goergen [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, July 22, 2003 10:26 AM
To: Mojtaba Faridzad; [EMAIL PROTECTED]
Subject: Re: how to limit COUNT(*)


a LIMIT will not work in any case with COUNT since you will always get
exactly one row. and what shall a LIMIT 1 on 1 row do here?

but you can try the MAX function here: (i guess it exists :)

SELECT MAX(COUNT(*), 10001) as numfound FROM mytable WHERE mycond;

-yves


-Ursprüngliche Nachricht- 
Von: Mojtaba Faridzad [EMAIL PROTECTED]
An: [EMAIL PROTECTED]
Gesendet: Dienstag, 22. Juli 2003 15:40
Betreff: Re: how to limit COUNT(*)


 for example:
 
 SELECT COUNT(*) as numfound FROM mytable WHERE mycondition;
 
 in this query, mytable and mycondition are variable and on run time, 
 they are changed. I use this query to jump to the last page of a grid 
 form. sometimes the query may have more than million records and I 
 want to give a warning to the user to specify a condition to limit the

 number of records. I would like to count the records upto 1 (for 
 example) and if the records are more than this, stop counting and ask 
 user to change the condition. to solve this problem I did something 
 like this:
 
 SELECT one_field FROM mytable WHERE mycondition LIMIT 10001;
 
 if the number of records of this query is equal to 10001, then I show 
 the warning message. but this query is not as fast of COUNT query. is 
 there any way to limit the first query?
 
 thanks
 
 - Original Message -
 From: gerald_clark [EMAIL PROTECTED]
 To: Mojtaba Faridzad [EMAIL PROTECTED]
 Cc: [EMAIL PROTECTED]
 Sent: Tuesday, July 22, 2003 9:15 AM
 Subject: Re: how to limit COUNT(*)
 
 
  Perhaps you could post some examples of what you have tried. I don't

  understand what you are asking.
 
  Mojtaba Faridzad wrote:
 
  Hi,
  
  I guess there is no way to limit COUNT(*). Is that right? We cannot

  use
 the
  result of COUNT in WHERE condition or LIMIT doesn't help. In this 
  case so far I have retrieved a field and used LIMIT. Is there a 
  better way to control it?
  
  Thanks
  
  
  
  
 
 
 
  --
  MySQL General Mailing List
  For list archives: http://lists.mysql.com/mysql
  To unsubscribe:
 http://lists.mysql.com/[EMAIL PROTECTED]
 
 
 
 --
 MySQL General Mailing List
 For list archives: http://lists.mysql.com/mysql
 To unsubscribe:
http://lists.mysql.com/[EMAIL PROTECTED]
 

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]





--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



RE: NEWBIE how can i store images in a database?

2003-07-09 Thread Mike Brum
You'd want to use a BLOB (binary large object) if that's what your goal
is.

But if you're using this for a web application I'd highly suggest that
you instead save images to a directory and make a reference to the path
in the database. If you have many BLOB inserts or selects on a site,
your database will be A LOT slower than pulling a string URL and then
the browser simply retrieving the image from the directory specified.

-M

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, July 09, 2003 4:22 PM
To: [EMAIL PROTECTED]
Subject: NEWBIE how can i store images in a database?

hello,

i'm just changing from openbase SQL to MySQL, so i'm new here.

in openbase i had images stored in a database. the 'type' was set to 
'object'.
i can't find something like that here and also not in the manual.

what should i use?

thanx for advance

cheers

christian


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]





-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



RE: Characters

2003-06-10 Thread Mike Brum
Addslashes()

http://us3.php.net/manual/en/function.addslashes.php

-M

-Original Message-
From: Steve Marquez [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, June 10, 2003 4:28 PM
To: MySQL List; PHP eMail List
Subject: Characters

I am inserting a file via a PHP form. It works great, however, if there
is a
word that has quotes in it, then it does not work at all.

Is there a way to make it so that MySQL will receive a word with
quotes?

Thanks

-Steve Marquez
[EMAIL PROTECTED]


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]





-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



RE: Why don't ISPs use v4

2003-03-31 Thread Mike Brum
Ben, this is really a question you have to pose to them.

Many professional ISPs won't just automatically upgrade to the newest
version of X before taking the time to create a full test environment to run
through any and all circumstances that they think they might come across.

Also, a new version of any software usually has some bugs and a lot of ISP
and other software hosting companies will wait for a few updates to be
implimented into the code to patch any holes that weren't noticed at launch.

Other than that, you really do have to ask your ISPs.

-Mike

-Original Message-
From: Ben Edwards [mailto:[EMAIL PROTECTED]
Sent: Monday, March 31, 2003 12:00 PM
To: [EMAIL PROTECTED]
Subject: Why don't ISPs use v4


Anyone know why the two ISPs I use (www.pair.com, www.oneandone.co.uk) are
still using V3 and don't have any timescales for upgrading?

Ben


* Ben Edwards  +44 (0)117 968 2602 *
* Critical Site Builderhttp://www.criticaldistribution.com *
* online collaborative web authoring content management system *
* Get alt news/views films online   http://www.cultureshop.org *
* i-Contact Progressive Video  http://www.videonetwork.org *
* Smashing the Corporate image   http://www.subvertise.org *
* Bristol Indymedia   http://bristol.indymedia.org *
* Bristol's radical news http://www.bristle.org.uk *
* PGP : F0CA 42B8 D56F 28AD 169B  49F3 3056 C6DB 8538 EEF8 *




-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



RE: Validations

2003-03-30 Thread Mike Brum
As Bhavin stated, ENUM is one way to do this, but you can (and should)
validate all data in your scripts prior to entering it in your database.
(assuming that you're not just using the command-line interface and have an
actual GUI)

All user-supplied information should be checked for validity - and if you
need the data to conform to a specific set, then you can easily check it
against an array of valid responses.

Just my $.02.

-Mike

-Original Message-
From: Bhavin Vyas [mailto:[EMAIL PROTECTED]
Sent: Sunday, March 30, 2003 9:01 PM
To: warm-fusion; [EMAIL PROTECTED]
Subject: Re: Validations


I don't think Validation is possible. Look up ENUM, which is very different,
but just might help you a little.
- Original Message -
From: warm-fusion [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Sunday, March 30, 2003 5:25 PM
Subject: Validations


 Hi, I'm a newbie to MySQL, and I'm wondering whether there is any way to
 set validations on acceptable field values when using the 'create
 table()' etc. statements? I've performed a (most cursory) search of the
 documentation, but that didn't turn up anything useful. Any suggestions?
 Many thanks!

 Marc


 On two occasions I have been asked [by members of Parliament!], 'Pray,
 Mr. Babbage, if you put into the machine wrong figures, will the right
 answers come out?' I am not able rightly to apprehend the kind of
 confusion of ideas that could provoke such a question.
 ~Charles Babbage


 --
 MySQL General Mailing List
 For list archives: http://lists.mysql.com/mysql
 To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]





-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]