-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Ian M. Evans wrote:
| <snip>
| SELECT @totalVotes:=COUNT(titleid) FROM movieratings
| </snip>
|
What version of MySQL are you using? I just tried this on MySQL-4.0.2
and it worked.
If your version of MySQL doesn't support variables (they go pretty far
back, 3.23.x supports them), then just issue a similar query and store
the result yourself...
SELECT COUNT(titleid) as totalVotes FROM movieratings
Then use whatever programming language you are using to retrieve that
value, and then stuff it back into the second query.
-Mark
- --
For technical support contracts, visit https://order.mysql.com/?ref=mmma
~ __ ___ ___ ____ __
~ / |/ /_ __/ __/ __ \/ / Mark Matthews <[EMAIL PROTECTED]>
~ / /|_/ / // /\ \/ /_/ / /__ MySQL AB, Full-Time Developer - JDBC/Java
~ /_/ /_/\_, /___/\___\_\___/ Flossmoor (Chicago), IL USA
~ <___/ www.mysql.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6-2 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQE9NA1OtvXNTca6JD8RAhO+AJ44Ai7bAPdBDPmcdAUjriBvq/o9FQCgtLyD
PQpYyRaCfcZHF5bUNJSazEk=
=GagT
-----END PGP SIGNATURE-----
---------------------------------------------------------------------
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