Re: How to update MySQL table based on 3 other tables

2013-09-03 Thread shawn green

Hello Neil,

On 8/24/2013 5:21 AM, Neil Tompkins wrote:

I have the following four MySQL tables

Region
RegionId

City
CityId
RegionId

Hotel
HotelId
CityId

HotelRegion
HotelId
RegionId

I'm struggling to write a UPDATE statement to update the City table's
RegionId field from data in the HotelRegion table.

Basically how can I update the City table with the correct RegionId where
the HotelId in the HotelRegion table matches the City table's CityId.

This is my UPDATE statement at the moment

UPDATE City cSET c.RegionId = (SELECT DISTINCT(HotelRegion.RegionId)
FROM HotelRegion INNER JOIN Hotel ON Hotel.HotelID =
HotelRegion.HotelIDINNER JOIN City ON City.CityId = Hotel.CityIdWHERE
City.CityId = 1233)WHERE c.CityId = 1233



Have you tried the multi-table syntax of the UPDATE command?
http://dev.mysql.com/doc/refman/5.6/en/update.html


UPDATE City c INNER JOIN HotelRegion h ON h.HotelID = c.CityID
SET City.RegionID = h.RegionID
WHERE ...

--
Shawn Green
MySQL Principal Technical Support Engineer
Oracle USA, Inc. - Hardware and Software, Engineered to Work Together.
Office: Blountville, TN

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



How to update MySQL table based on 3 other tables

2013-08-24 Thread Neil Tompkins
I have the following four MySQL tables

Region
RegionId

City
CityId
RegionId

Hotel
HotelId
CityId

HotelRegion
HotelId
RegionId

I'm struggling to write a UPDATE statement to update the City table's
RegionId field from data in the HotelRegion table.

Basically how can I update the City table with the correct RegionId where
the HotelId in the HotelRegion table matches the City table's CityId.

This is my UPDATE statement at the moment

UPDATE City cSET c.RegionId = (SELECT DISTINCT(HotelRegion.RegionId)
FROM HotelRegion INNER JOIN Hotel ON Hotel.HotelID =
HotelRegion.HotelIDINNER JOIN City ON City.CityId = Hotel.CityIdWHERE
City.CityId = 1233)WHERE c.CityId = 1233


RE: Serious error in update Mysql 4.1.7

2004-12-03 Thread SciBit MySQL Team

Hi Luciano,

Not that this reply will solve your problem, but let it serve as a notice. It 
is NEVER a good idea to use a FLOAT/BLOB column in your where clause as MySQL 
can not uniquely identify the record.  Especially not with floats because of 
the inherent floating point error made between machines after a specific number 
of decimals (which depends on the hardware on which the MySQL is running). To 
clarify:

select MyFloat from MyTable;

Machine A might result in:
0.123456789012345[987345765]

Machine B, using exactly the same MySQL version with exactly the same table and 
data:
0.123456789012345[765365423]

Because of precision floating point errors (in the sample, after the 15th 
decimal) the values in the square brackets will differ and effectively be 
random numbers.  You can thus see the problem in asking MySQL to match floating 
point data using a WHERE clause.  In fact you can do the same query twice on 
the same machine and MySQL won't be able to locate the record as the ultimate 
float value will differ twice in a row.  Always remember computers are binary 
machines which loves integers. After filling the internal 8 bytes with a 
floating value, the rest of any floating value precision becomes a toss up.

Another sample (MySQL 4.1.7):
mysql> select pi();
+--+
| PI() |
+--+
| 3.141593 |
+--+
1 row in set (0.00 sec)

mysql> select pi()=3.141593;
+---+
| pi()=3.141593 |
+---+
| 0 |
+---+
1 row in set (0.00 sec)

If the sample you gave was auto-generated by the MyODBC driver it most likely 
compiled the WHERE clause because you don't have an unique primary key in your 
table.  Best advise is to always add a primary key AUTOINC column to all 
tables.  This will not only result in all your queries always being able to 
find the exact record, but will also reduce the traffic your current queries 
cause.  The addition of an AUTOINC column is mainly due to MySQL's lack of 
server side cursors. This will be corrected it seems in MySQL 5, after which 
everyone will always be able to find their records independent of the data 
contained in the table.

Kind Regards
SciBit MySQL Team
http://www.scibit.com
MySQL Products:
http://www.scibit.com/products/mycon
http://www.scibit.com/products/mysqlcomponents
http://www.scibit.com/products/mysqlx
http://www.scibit.com/products/mascon

> -Original Message-
> From: "Luciano Pulvirenti" <[EMAIL PROTECTED]>
> To: "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
> CC: 
> Subject: Serious error in update Mysql 4.1.7
> Sent: Fri, 03 Dec 2004 08:18:05 GMT
> Received: Fri, 03 Dec 2004 08:22:55 GMT
> Read: Fri, 03 Dec 2004 09:24:15 GMT
> I am trying Mysql 4.1.7 before putting it in production in 4.0.16 
> substitution on Windows NT.
> I have found an anomaly for me serious.
> I use Visual Basic 6 with ADO last version and the driver MYODBC 3.51.10.
> The program produces the following query:
> 
> UPDATE `paghe`.`anagpaghe`
> SET `giorni_congedo_mp`=1.25000e+001,
> `giorni_congedo_anno_prec_mp`=0.0e+000,
> `giorni_permessi_retrib_mp`=2.0e+000,
> `giorni_congedo`=1.15000e+001,
> `giorni_congedo_anno_prec`=0.0e+000,
> `giorni_permessi_retribuiti`=2.0e+000,
> `swnuovo`=0
> WHERE `matricola`=43258
> AND `giorni_congedo_mp`=1.25000e+001
> AND `giorni_congedo_anno_prec_mp`=0.0e+000
> AND `giorni_permessi_retrib_mp`=2.0e+000
> AND `giorni_congedo`=1.15000e+001
> AND `giorni_congedo_anno_prec`=0.0e+000
> AND `giorni_permessi_retribuiti`=2.0e+000
> AND `swnuovo`=1
> 
> 
> Mysql doesn't succeed to update the record because no succeeds in finding 
> the record corresponding to the syntax WHERE.
> I have made some tests have discover that the cause is
> 
> AND `giorni_congedo`=1.15000e+001
> 
> In the version 4.0.16 work correctly.
> The fields "giorni..." have declared in the structure double(5,1).
> Thank you 
> 
> 
> 
> -- 
> Internal Virus Database is out-of-date.
> Checked by AVG Anti-Virus.
> Version: 7.0.290 / Virus Database: 265.4.3 - Release Date: 26/11/2004
> 
> 
> 
> -- 
> MySQL Windows Mailing List
> For list archives: http://lists.mysql.com/win32
> 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: [OT] Email heaaders and threading (was Re: update MySQL)

2004-10-07 Thread David Brodbeck
> -Original Message-
> From: Michael Stassen [mailto:[EMAIL PROTECTED]

> This tells the recipient's email client that your message is 
> a reply, not a new message, despite your efforts to change the subject and

> recipients.  Many email clients use that header to decide which thread a
message 
> belongs to.  That's actually the point of the header.

I get it now. I wasn't aware of that, since every email client I've ever
seen seems to thread strictly by subject.

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



Re: update MySQL

2004-10-06 Thread Jeff Smelser
On Wednesday 06 October 2004 02:10 pm, Scott Hamm wrote:

> Like I said before it "seems" to group by "threads".  Therefore, it is
> close enough.

Right! thats why Microsoft thrives. Because as long as it appears to work, its 
all good.. :)

Jeff


pgpAXe4d5h6QD.pgp
Description: PGP signature


Re: update MySQL

2004-10-06 Thread Jim Winstead
Hey folks.

Apparently I need to say it again: this discussion is off-topic for this
mailing list. Please either let it die or take the discussion off-list.

Thanks.

Jim Winstead
MySQL Inc.

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



RE: update MySQL

2004-10-06 Thread Scott Hamm
Like I said before it "seems" to group by "threads".  Therefore, it is close
enough.

-Original Message-
From: Michael Satterwhite [mailto:[EMAIL PROTECTED]
Sent: Wednesday, October 06, 2004 3:05 PM
To: [EMAIL PROTECTED]
Subject: Re: update MySQL


-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On Tuesday 05 October 2004 14:39, Scott Hamm wrote:
> Jeff,
>
>   If you sort it by conversation topic, then it will seem to group by
> "threads".
> I'm running Outlook 2000.

Not the same thing. Threading uses the "In-reply-to" header. Messages will 
stay in the correct thread even if the subject changes - which is why it 
makes a difference.

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.2.4 (GNU/Linux)

iD8DBQFBZEH2jeziQOokQnARAmKiAJ4ww4xc4BOGxnOoXaXlNPxOYvM18gCfVQy1
E+90ewHDuSc7AKQGkjBzIEc=
=1mEs
-END PGP SIGNATURE-

-- 
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: update MySQL

2004-10-06 Thread Michael Satterwhite
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On Tuesday 05 October 2004 14:39, Scott Hamm wrote:
> Jeff,
>
>   If you sort it by conversation topic, then it will seem to group by
> "threads".
> I'm running Outlook 2000.

Not the same thing. Threading uses the "In-reply-to" header. Messages will 
stay in the correct thread even if the subject changes - which is why it 
makes a difference.

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.2.4 (GNU/Linux)

iD8DBQFBZEH2jeziQOokQnARAmKiAJ4ww4xc4BOGxnOoXaXlNPxOYvM18gCfVQy1
E+90ewHDuSc7AKQGkjBzIEc=
=1mEs
-END PGP SIGNATURE-

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



Re: update MySQL

2004-10-06 Thread Michael Satterwhite
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On Tuesday 05 October 2004 14:23, David Brodbeck wrote:
> Well, that's nice...
>
> I just don't see what difference it makes.  As far as I can see, the
> outcome is identical either way...

If the recipients email program threads messages, it makes a big difference.

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.2.4 (GNU/Linux)

iD8DBQFBZEG6jeziQOokQnARAq2qAJ9dHUqz+mmTGTNp7xRiu4hZipIBcwCgpfxX
lnNkjyvux/GUi/pZCgNzmJ8=
=f0bF
-END PGP SIGNATURE-

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



Re: update MySQL

2004-10-06 Thread Michael Satterwhite
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On Tuesday 05 October 2004 15:18, Ed Lazor wrote:

> Also, back to my original question, what are you seeing that denotes the
> difference between whether I reply or create a new message when starting a
> new topic?  After all, I took care of changing the recipient list and the
> subject field.  Is header information different?  Does your email client
> sort or group messages differently?

I haven't been following this, but I can make a good guess.

Some email clients can thread messages - my client (KMail) is one of them. If 
you hit reply, your message gets placed in the thread that you replied to. It 
is *NOT* based on the subject, it uses the "In-Reply-To" header. If you enter 
a new message, it begins a new thread.

If it is really a new message, it is out of context to put it into an existing 
thread. If it is really a reply, it may be lost in a new thread.

Because of threaded emails, it is considered bad practice to start new threads 
by a reply - or use "New" to reply to a thread. I won't claim I've never done 
it, but it is bad practice.
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.2.4 (GNU/Linux)

iD8DBQFBZC6mjeziQOokQnARAp5wAJ9QehvPkNRVwKGgUkAjAm7jkQfRowCgrWaH
BwWO1G8aButW0ejjh3P2O4w=
=EkBR
-END PGP SIGNATURE-

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



RE: [OT] Email heaaders and threading (was Re: update MySQL)

2004-10-05 Thread Ed Lazor
> Ed,
> 
> When you *reply* to a message, most mail clients (including yours) add a
> header
> like this:
> 
>In-Reply-To: <[EMAIL PROTECTED]>
> 
> That stuff in between the < and > is the message-id of the replied-to
> message.
> 
> This tells the recipient's email client that your message is a reply, not
> a new
> message, despite your efforts to change the subject and recipients.  Many
> email
> clients use that header to decide which thread a message belongs to.
> That's
> actually the point of the header.
> 
> I'm not interested in a debate over the relative merits of different mail
> clients and view modes.  The point is simply this: Many people choose to
> view
> their mail in threaded mode.  When you start a new topic by replying to an
> old
> topic, you disrupt that organization.
> 
> Ultimately, etiquette is about choosing to accomodate the needs of other
> people,
> not about rules.  You didn't know the effect you were having before, but
> now you
> do.  What you do with that information is up to you, but I would suggest
> that
> starting a new message is no more work than changing the subject and
> recipients
> list of a reply.
> 
> Michael

Thanks Michael.  I think you've done an excellent presentation on the merits
of starting a new topic with a new message.  I'm definitely convinced and
will be happy to do my part to help out.

-Ed




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



[OT] Email heaaders and threading (was Re: update MySQL)

2004-10-05 Thread Michael Stassen
Ed Lazor wrote:
-Original Message-
Actually its proper email etticate..  look it up if you don't believe me..

That sounds like a copout.  Could present formal references to back this up?
I'm trying to substantiate your claims, but a Google search failed to bring
up anything relevant when searching with the keywords of etiqette, email,
and replying.
Here are some of the references that did come up:
http://coco.essortment.com/emailetiquette_rtqh.htm
http://www.dynamoo.com/technical/etiquette.htm
http://www.cdtl.nus.edu.sg/success/sl6.htm
Also, back to my original question, what are you seeing that denotes the
difference between whether I reply or create a new message when starting a
new topic?  After all, I took care of changing the recipient list and the
subject field.  Is header information different?  Does your email client
sort or group messages differently?
-Ed
Ed,
When you *reply* to a message, most mail clients (including yours) add a header 
like this:

  In-Reply-To: <[EMAIL PROTECTED]>
That stuff in between the < and > is the message-id of the replied-to message.
This tells the recipient's email client that your message is a reply, not a new 
message, despite your efforts to change the subject and recipients.  Many email 
clients use that header to decide which thread a message belongs to.  That's 
actually the point of the header.

I'm not interested in a debate over the relative merits of different mail 
clients and view modes.  The point is simply this: Many people choose to view 
their mail in threaded mode.  When you start a new topic by replying to an old 
topic, you disrupt that organization.

Ultimately, etiquette is about choosing to accomodate the needs of other people, 
not about rules.  You didn't know the effect you were having before, but now you 
do.  What you do with that information is up to you, but I would suggest that 
starting a new message is no more work than changing the subject and recipients 
list of a reply.

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


RE: update MySQL

2004-10-05 Thread Ed Lazor
Outlook 2003 here and its working just like Scott's (Converation, Subject,
etc.).


> -Original Message-
>   If you sort it by conversation topic, then it will seem to group by
> "threads".
> I'm running Outlook 2000.
> 
> Cause your doesnt support threads.. Outlook was the only one I knew off
> that
> 
> did not.


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



RE: update MySQL

2004-10-05 Thread Ed Lazor
> -Original Message-
> Actually its proper email etticate..  look it up if you don't believe me..

That sounds like a copout.  Could present formal references to back this up?
I'm trying to substantiate your claims, but a Google search failed to bring
up anything relevant when searching with the keywords of etiqette, email,
and replying.

Here are some of the references that did come up:

http://coco.essortment.com/emailetiquette_rtqh.htm
http://www.dynamoo.com/technical/etiquette.htm
http://www.cdtl.nus.edu.sg/success/sl6.htm

Also, back to my original question, what are you seeing that denotes the
difference between whether I reply or create a new message when starting a
new topic?  After all, I took care of changing the recipient list and the
subject field.  Is header information different?  Does your email client
sort or group messages differently?

-Ed



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



Re: update MySQL

2004-10-05 Thread Jim Winstead
Hi.

This discussion is very off-topic for this list. Please take the
discussion of how to use your email client off-list.

Thanks.

Jim Winstead
MySQL Inc.

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



Re: update MySQL

2004-10-05 Thread Jeff Smelser
On Tuesday 05 October 2004 02:39 pm, Scott Hamm wrote:

>  If you sort it by conversation topic, then it will seem to group by
> "threads".
> I'm running Outlook 2000.

Seem.. Thats the key word.. Its not true threading support..

These are not there for looks.. 

References: 
<[EMAIL PROTECTED]>
In-Reply-To: 
<[EMAIL PROTECTED]>

Jeff.


pgpgRjZu4Ewfs.pgp
Description: PGP signature


RE: update MySQL

2004-10-05 Thread Scott Hamm
Jeff,

If you sort it by conversation topic, then it will seem to group by
"threads".
I'm running Outlook 2000. 


Scott

-Original Message-
From: Jeff Smelser [mailto:[EMAIL PROTECTED]
Sent: Tuesday, October 05, 2004 3:36 PM
To: [EMAIL PROTECTED]
Subject: Re: update MySQL


On Tuesday 05 October 2004 02:23 pm, David Brodbeck wrote:
>
> Well, that's nice...

Hmm

> I just don't see what difference it makes.  As far as I can see, the
> outcome is identical either way...

Cause your doesnt support threads.. Outlook was the only one I knew off that

did not.

Jeff

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



Re: update MySQL

2004-10-05 Thread Jeff Smelser
On Tuesday 05 October 2004 02:23 pm, David Brodbeck wrote:
>
> Well, that's nice...

Hmm

> I just don't see what difference it makes.  As far as I can see, the
> outcome is identical either way...

Cause your doesnt support threads.. Outlook was the only one I knew off that 
did not.

Jeff


pgp1rxawLcFkW.pgp
Description: PGP signature


RE: update MySQL

2004-10-05 Thread David Brodbeck
> -Original Message-
> From: Jeff Smelser [mailto:[EMAIL PROTECTED]

> On Tuesday 05 October 2004 01:56 pm, David Brodbeck wrote:
> 
> > Saves having to retype the list address, or look it up.  I 
> don't see what
> > difference it makes...
> 
> Click on the email, on mine, it brings up a nice to empty 
> message with the 
> email address..

Well, that's nice...

I just don't see what difference it makes.  As far as I can see, the outcome
is identical either way...

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



Re: update MySQL

2004-10-05 Thread Jeff Smelser
On Tuesday 05 October 2004 01:56 pm, David Brodbeck wrote:

> Saves having to retype the list address, or look it up.  I don't see what
> difference it makes...

Click on the email, on mine, it brings up a nice to empty message with the 
email address..

Jeff


pgp50O9uZVT4t.pgp
Description: PGP signature


Re: update MySQL

2004-10-05 Thread Jeff Smelser
On Tuesday 05 October 2004 01:55 pm, you wrote:
> We're not perfectionist like you. :)

Actually its proper email etticate.. look it up if you don't believe me..

Jeff


pgpjB48FEXyL0.pgp
Description: PGP signature


RE: update MySQL

2004-10-05 Thread David Brodbeck
> -Original Message-
> From: Jeff Smelser [mailto:[EMAIL PROTECTED]

> Whats the deal and this list? No one can ever just hit new 
> message, they 
> always hit reply and put a new subject in..

Saves having to retype the list address, or look it up.  I don't see what
difference it makes...

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



RE: update MySQL

2004-10-05 Thread Scott Hamm
We're not perfectionist like you. :)



> -Original Message-
> From: Jeff Smelser [SMTP:[EMAIL PROTECTED]
> Sent: Tuesday, October 05, 2004 2:23 PM
> To:   [EMAIL PROTECTED]
> Subject:  Re: update MySQL
> 
> On Tuesday 05 October 2004 01:14 pm, Ed Lazor wrote:
> > Does anything need to be done to my data while upgrading the server from
> > 3.23 to 4.0.21?
> 
> Whats the deal and this list? No one can ever just hit new message, they 
> always hit reply and put a new subject in..
> 
> Geez.. This list is horrible with it..
> 
> Jeff

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



RE: update MySQL

2004-10-05 Thread Ed Lazor
You're close.  I hit reply to all, typed in a new subject, and then modified
the To field by removing all but the [EMAIL PROTECTED] address.

Come to think of it, I'm hitting reply on this message as well.

What difference are you seeing that makes this significant?

-Ed


> -Original Message-
> On Tuesday 05 October 2004 01:14 pm, Ed Lazor wrote:
> > Does anything need to be done to my data while upgrading the server from
> > 3.23 to 4.0.21?
> 
> Whats the deal and this list? No one can ever just hit new message, they
> always hit reply and put a new subject in..
> 
> Geez.. This list is horrible with it..
> 
> Jeff


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



Re: update MySQL

2004-10-05 Thread Jeff Smelser
On Tuesday 05 October 2004 01:14 pm, Ed Lazor wrote:
> Does anything need to be done to my data while upgrading the server from
> 3.23 to 4.0.21?

Whats the deal and this list? No one can ever just hit new message, they 
always hit reply and put a new subject in..

Geez.. This list is horrible with it..

Jeff


pgpZ3q0X0WvJ5.pgp
Description: PGP signature


update MySQL

2004-10-05 Thread Ed Lazor
Does anything need to be done to my data while upgrading the server from
3.23 to 4.0.21?

Thanks,

Ed



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



Update MySQL row using URL link?

2004-08-16 Thread Bob Afifi
I currently update MySQL rows using phpMyAdmin.
For example, dropping the following into the
phpMyAdmin GUI:

UPDATE mysql_db SET publish = 1 WHERE Date =
'Sunday, August 15, 2004 21:04:32'

Since I get the update info in an e-mail send
whenever the form is submitted, I'd like to turn
querys like the above encoded into a URL -
bypassing phpMyAdmin - which when clicked, will
update the row.

I found this article last night: "Make SQL
Queries over HTTP with XML with VS.NET "
(http://www.aspfree.com/c/a/ASP/Make-SQL-Queries-over-HTTP-with-XML-with-VSNET/
)

"SELECT CustomerId, CompanyName FROM Customer"

http://localhost/sql?sql=select%20CustomerId,%20CompanyName%20from%20Customers%20FOR%20XML%20AUTO

=

The above looks very much like what I have in
mind, but for MySQL.  Anybody know how to do
this?

Many thanks in advance,

-Bob

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



Email link from Perl script to update MySQL?

2004-03-08 Thread Bob Afifi
I'd like to modify the email send I presently get
from the Perl script when a new record is
submitted from the form to contain an email link
which if I click on it, will update MySQL.
Anybody know how that might best be done and if
so, can you please advise?

Many thanks in advance,

-Bob 


__
Do you Yahoo!?
Yahoo! Search - Find what you’re looking for faster
http://search.yahoo.com

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



RE: Cannot Update MYSQL Database

2003-03-25 Thread Kyle Lange
I think you probably need to do one of the following;

Insert into info set referer = ?

Or

Insert into info (referer) values (?)

But I could be wrong. 



-Original Message-
From: jsp [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, 25 March 2003 07:17
To: 'Tomcat Users List'
Cc: [EMAIL PROTECTED]
Subject: Cannot Update MYSQL Database


I'm running this code with no errors but it's not inserting the string
into the database ?

public void addInfo( String referer )
  throws SQLException, Exception {
 if (con != null) {
try{

   PreparedStatement updateInfo;
   updateInfo = con.prepareStatement(
"insert into info(?)");
   updateInfo.setString(1, referer )
   updateInfo.execute();



}
   catch (SQLException sqle){ 
  sqle.printStackTrace();
   }
 }
 else {
error = "Connection with database was lost.";
throw new Exception( error );
 }
  }

This is my database
mysql> desc info;
+-+---+--+-+-+---+
| Field   | Type  | Null | Key | Default | Extra |
+-+---+--+-+-+---+
| ID  | int(11)   |  | PRI | 0   |   |
| REFERER | char(200) | YES  | | NULL|   |
+-+---+--+-+-+---+
2 rows in set (0.00 sec)

Any Idea why nothing is showing up. Referer is a String its printing out
on the page but not updating the database?

Thanks anyone
-wiley

   


-- 
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]



Cannot Update MYSQL Database

2003-03-24 Thread jsp
I'm running this code with no errors but it's not inserting the string
into the database ?

public void addInfo( String referer )
  throws SQLException, Exception {
 if (con != null) {
try{

   PreparedStatement updateInfo;
   updateInfo = con.prepareStatement(
"insert into info(?)");
   updateInfo.setString(1, referer )
   updateInfo.execute();



}
   catch (SQLException sqle){ 
  sqle.printStackTrace();
   }
 }
 else {
error = "Connection with database was lost.";
throw new Exception( error );
 }
  }

This is my database
mysql> desc info;
+-+---+--+-+-+---+
| Field   | Type  | Null | Key | Default | Extra |
+-+---+--+-+-+---+
| ID  | int(11)   |  | PRI | 0   |   |
| REFERER | char(200) | YES  | | NULL|   |
+-+---+--+-+-+---+
2 rows in set (0.00 sec)

Any Idea why nothing is showing up. Referer is a String its printing out
on the page but not updating the database?

Thanks anyone
-wiley

   


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



re: update mysql

2002-12-22 Thread Egor Egorov
On Friday 20 December 2002 22:08, John Chang wrote:

> I e-mailed the list but haven't received a response.  I have win2k w/
> 3.23.53 and need to update it to 54.  Is there a patch or do I have to do a
> reinstall or install on top of it?

You can just install 3.23.54 over 3.23.53, but backup of the databases is 
recommended. 



-- 
For technical support contracts, goto https://order.mysql.com/?ref=ensita
This email is sponsored by Ensita.net http://www.ensita.net/
   __  ___ ___   __
  /  |/  /_ __/ __/ __ \/ /Egor Egorov
 / /|_/ / // /\ \/ /_/ / /__   [EMAIL PROTECTED]
/_/  /_/\_, /___/\___\_\___/   MySQL AB / Ensita.net
   <___/   www.mysql.com




-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




update mysql

2002-12-20 Thread John Chang
I e-mailed the list but haven't received a response.  I have win2k w/
3.23.53 and need to update it to 54.  Is there a patch or do I have to do a
reinstall or install on top of it?

mysql


-
Before posting, please check:
  http://www.mysql.com/manual.php   (the manual)
  http://lists.mysql.com/   (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




executemany & UPDATE (MySQL & Python)

2002-06-14 Thread Nick Arnett

Can anyone confirm that it is *not* possible to pass a list to the Python
MySQLdb module in UPDATE operations?  In other words, this kind of thing
works:

self.dbh.execute("INSERT INTO Foo (blah, blorg,snork) VALUES
(%s,%s,%s)",myList)

... But this kind doesn't appear to work for me:

self.dbh.execute("UPDATE Foo SET blah=%s, blorg=%s WHERE snork=%s",myList)

Doing the latter with a loop in Python is much slower than I'd expect that
doing it with a list would be.

Nick

--
[EMAIL PROTECTED]
(408) 904-7198


-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




RE: update mysql database via php form

2002-03-15 Thread Gurhan Ozen

Hi,
didn't really understand what you are asking.. Can you please be more
specific? What exactly you are asking?

Gurhan


-Original Message-
From: Valerie Brooks [mailto:[EMAIL PROTECTED]]
Sent: Friday, March 15, 2002 5:28 PM
To: [EMAIL PROTECTED]
Subject: update mysql database via php form


Hi,

I'm using php form to update mysql database, the form has several drop down
menus to choose from.  What would the best way of updating information in
the
database, update, as a function?  Any help will be greatly appericated.

Thanks.


-


Valerie Brooks
Fujitsu Software
Voice: (408)456-7222
Email:  [EMAIL PROTECTED]


"There's no limit to what can be accomplished
 if it doesn't matter who gets the credit"


-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail
<[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php


-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




update mysql database via php form

2002-03-15 Thread Valerie Brooks

Hi,

I'm using php form to update mysql database, the form has several drop down 
menus to choose from.  What would the best way of updating information in the 
database, update, as a function?  Any help will be greatly appericated.

Thanks.


-


Valerie Brooks
Fujitsu Software
Voice: (408)456-7222
Email:  [EMAIL PROTECTED]


"There's no limit to what can be accomplished
 if it doesn't matter who gets the credit"


-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Re: After php udate, php pages no longer update MySQL database

2002-02-28 Thread Dieter Lunn

If you compiled it did you use --with-mysql? 

On February 28, 2002 01:30 pm, you wrote:
> I just reinstalled the latest version of php on my system and after doing
> so the pages that existed within the site no longer allow records to be
> updated in MySQL, records that updated fine before. Any ideas why or how
> to fix?
>
> Thanks
>
>
>
> -
> Before posting, please check:
>http://www.mysql.com/manual.php   (the manual)
>http://lists.mysql.com/   (the list archive)
>
> To request this thread, e-mail <[EMAIL PROTECTED]>
> To unsubscribe, e-mail
> <[EMAIL PROTECTED]> Trouble
> unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Re: After php udate, php pages no longer update MySQL database

2002-02-28 Thread Benjamin Pflugmann

Hi.

That's too few information to say anything concrete. Do you get any
error message? If not, please look how to enable error messages in PHP
(or change your script to log them). Then post the error message you
get.

Bye,

Benjamin.


On Thu, Feb 28, 2002 at 02:30:20PM -0500, [EMAIL PROTECTED] wrote:
> I just reinstalled the latest version of php on my system and after doing 
> so the pages that existed within the site no longer allow records to be 
> updated in MySQL, records that updated fine before. Any ideas why or how 
> to fix?
> 
> Thanks
[...]

-- 
[EMAIL PROTECTED]

-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




RE: After php udate, php pages no longer update MySQL database

2002-02-28 Thread Todd Williamsen

Which PHP version did you update to?  I have noticed in PHP 4.1.1 is
more anal about syntax

-Original Message-
From: Vernon [mailto:[EMAIL PROTECTED]] 
Sent: Thursday, February 28, 2002 1:30 PM
To: php-list; MySQL-list
Subject: After php udate, php pages no longer update MySQL database


I just reinstalled the latest version of php on my system and after
doing 
so the pages that existed within the site no longer allow records to be 
updated in MySQL, records that updated fine before. Any ideas why or how

to fix?

Thanks



-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail
<[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php


-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




RE: After php udate, php pages no longer update MySQL database

2002-02-28 Thread Simon Green

Sorry but questons
What is the update.log say (is it connecting)?
Is it just UPDATE, do SELECT's work?
Have you got

if (mysql_create_db ($DBname, $Link)){
print ("worked");
}else{
print ("fail");
}
etc...?

Simon

-Original Message-
From: Vernon [mailto:[EMAIL PROTECTED]]
Sent: 28 February 2002 19:30
To: php-list; MySQL-list
Subject: After php udate, php pages no longer update MySQL database


I just reinstalled the latest version of php on my system and after doing 
so the pages that existed within the site no longer allow records to be 
updated in MySQL, records that updated fine before. Any ideas why or how 
to fix?

Thanks



-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




After php udate, php pages no longer update MySQL database

2002-02-28 Thread Vernon

I just reinstalled the latest version of php on my system and after doing 
so the pages that existed within the site no longer allow records to be 
updated in MySQL, records that updated fine before. Any ideas why or how 
to fix?

Thanks



-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Cannot UPDATE mysql record in ASP

2002-02-13 Thread Danis Stéphane (NHQ-AC)

I get this error when trying to update a record using ASP recordsets.

Microsoft OLE DB Provider for ODBC Drivers error '80040e21' 
Multiple-step OLE DB operation generated errors. Check each OLE DB status
value, if available. No work was done. 
/Web_local/admin/xt_save.asp, line 39 


What is really strange is that the line # is referencing a line where I
assign a value to a field see code below the line is marked with asterisk.

Sub Update()
Set rs = Server.CreateObject("ADODB.Recordset")
sSql = "select * from table where ID="&ID
rs.Open sSql,aCn,3,3
*-->rs("DESCRIPTION")   = strDesc
rs("DETAILS")   = strDetails
rs("LAST_MODIFIED_DATE")= Now()
rs("ACTIVE_FLAG")   = "1"
rs.Update
rs.Close
Set rs = Nothing
End Sub

I tried a bunch of different things and I always get his error, any clue on
what is going on! BTW, this is my first system using MySQL as a back end.

Stephane

-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Re: Update MYSQL command with PHP

2001-11-08 Thread DL Neil

> Question is there something wrong with this syntax when using the MYSQL
> Update command in PHP , where I change the record by users editing the
> fields on a web form then  those are extracted to update a  record in a
> table.
> Here's what I have tried I don't get any syntax errors with either of
> these attempts
>
> $query1 = "UPDATE Qusers SET $field_str WHERE UserName='$username'";
> $result2 = mysql_query($query1);
>
>
> Second Example
>
> $query1 = "UPDATE Qusers SET BillAmt='$billamt' WHERE
> UserName='".$username."' AND Qusers.RID ='".$keyid."'";
> $result2 = mysql_query($query1);



Kory,

The PHP-db list (and archive) is full of answers to this question.
The first example looks a bit suspect unless $field_str holds a set clause in the 
form: column_name=expression,
and further that "expression" does NOT contain double quotes, eg a string value's 
delimiters.
You should precede these with several function calls to 'open' the db, and should 
follow every mysql_...() call
with an error check.
Prevailing wisdom suggests putting an echo between the two lines, so that you can see 
exactly what will be
passed as the query to MySQL.
Finally, if there is any question, that output can be copied-and-pasted into a command 
line query or a MySQL
administration tool to verify/confirm the SQL syntax.

Regards,
=dn


-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Re: Update MYSQL command with PHP

2001-11-08 Thread Kodrik

> $query1 = "UPDATE Qusers SET $field_str WHERE UserName='$username'";
> $result2 = mysql_query($query1);

It should be:
update Qusers set field_name='$field_str' where username='$username'";

-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Update MYSQL command with PHP

2001-11-08 Thread Kory Wheatley

Question is there something wrong with this syntax when using the MYSQL
Update command in PHP , where I change the record by users editing the
fields on a web form then  those are extracted to update a  record in a
table.
Here's what I have tried I don't get any syntax errors with either of
these attempts

$query1 = "UPDATE Qusers SET $field_str WHERE UserName='$username'";
$result2 = mysql_query($query1);


Second Example

$query1 = "UPDATE Qusers SET BillAmt='$billamt' WHERE
UserName='".$username."' AND Qusers.RID ='".$keyid."'";
$result2 = mysql_query($query1);

Kory Wheatley



-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Re: [beginner] How to update mysql with Linux ?

2001-06-11 Thread Gabriele Bartolini

At 09.42 11/06/01 +0200, Francesco Marchioni wrote:
>Hi all,
>I'd like to update my version of Mysql on linux.
>How can I do it so that I don't have two copies of mysql on my machine ?
>Do I have to clean up the folder "mysql" and then install the new version 
>under it?

I suggest you to dump all of the database you are interested in, first of 
all. That's pretty easy, just run mysqldump for every db.

>And what should I download -the source code or the binaries- in order to
>update the starting scripts under /etc/rc.d/init.d ?

It depends on which version you have already installed. Do you use RPMs or 
source code? And, which version of MySQL do you have?

However, you could also write me in italian ... but I guess personally, 
otherwise nobody will understand! :-)

Ciao
-Gabriele

-
Gabriele Bartolini - Computer Programmer
U.O. Rete Civica - Comune di Prato
Prato - Italia - Europa
e-mail: [EMAIL PROTECTED]
http://www.po-net.prato.it
-
A "Supernova" is the celestial
equivalent of "rm -rf /*" with
root permissions.
-


-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




[beginner] How to update mysql with Linux ?

2001-06-11 Thread Francesco Marchioni

Hi all,
I'd like to update my version of Mysql on linux. 
How can I do it so that I don't have two copies of mysql on my machine ?
Do I have to clean up the folder "mysql" and then install the new version under it?

And what should I download -the source code or the binaries- in order to
update the starting scripts under /etc/rc.d/init.d ?

Thanks a lot
Francesco
[EMAIL PROTECTED]