Re: [PHP-DB] Why not ?

2005-03-24 Thread Simon Rees
On Thursday 24 March 2005 17:26, JeRRy wrote:
>
> I was getting an error earlier stating round1 does not
> exist, however it does.  round1 table does not exist.
> So does not say round1.game1 does not exist.

Does a table named round1 exist in your database?
If so and you are using mysql > 4.0.4 you will need to mention all tables 
referenced in the WHERE clause in the UPDATE clause. e.g.

UPDATE tipping, round1
SET tipping.score = 3
WHERE round1.game1 = 'H'
AND tipping.username = 'jerry'

(assuming the score column you want to update is in the tipping table...)

You almost certainly want to join the two tables as well but without knowing 
your database it is impossible for me to say how.
If you are using an older mysql version what you want to do is probably 
impossible in one statement.

Simon

-- 
~~
Simon Rees  | [EMAIL PROTECTED]  |
ORA-03113: end-of-file on communication channel
~~

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP-DB] Why not ?

2005-03-24 Thread Bastien Koert
missing single quotes around text
UPDATE tipping SET score = 3 WHERE round1.game1 =' H'
AND tipping.username = 'jerry';
bastien
From: JeRRy <[EMAIL PROTECTED]>
To: php-db@lists.php.net
Subject: [PHP-DB] Why not ?
Date: Fri, 25 Mar 2005 04:05:28 +1100 (EST)
Why does this NOT work?
UPDATE tipping SET score = 3 WHERE round1.game1 = H
AND tipping.username = jerry;
Please inform?
J

Find local movie times and trailers on Yahoo! Movies.
http://au.movies.yahoo.com
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP-DB] Why not ?

2005-03-24 Thread JeRRy


--- "Larry E. Ullman" <[EMAIL PROTECTED]>
wrote:
> > Why does this NOT work?
> >
> > UPDATE tipping SET score = 3 WHERE round1.game1 =
> H
> > AND tipping.username = jerry;
> 
> For starters, you should quote strings in a query.
> There may also be a 
> problem with the round1 reference.
> 
> Larry
> 

I was getting an error earlier stating round1 does not
exist, however it does.  round1 table does not exist. 
So does not say round1.game1 does not exist.

But the table name exists.  And I use the correct
quotations, this does not effect it without it when i
use other queries.

I will keep trying...  If anyone knows, shoot! :)

J

Find local movie times and trailers on Yahoo! Movies.
http://au.movies.yahoo.com

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] Why not ?

2005-03-24 Thread Martin Norland
JeRRy wrote:
Why does this NOT work?
UPDATE tipping SET score = 3 WHERE round1.game1 = H
AND tipping.username = jerry;
Please inform?
You're not linking table round1 to table tipping in any way, and you've 
got some quoting issues.

something like this:
UPDATE tipping SET score=3 WHERE round1.game1='H' AND 
round1.username=tipping.username AND tipping.username='jerry';

cheers,
--
- Martin Norland, Sys Admin / Database / Web Developer, International 
Outreach x3257
The opinion(s) contained within this email do not necessarily represent 
those of St. Jude Children's Research Hospital.

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP-DB] Why not ?

2005-03-24 Thread Larry E . Ullman
Why does this NOT work?
UPDATE tipping SET score = 3 WHERE round1.game1 = H
AND tipping.username = jerry;
For starters, you should quote strings in a query. There may also be a 
problem with the round1 reference.

Larry
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php