PDA

View Full Version : Mysql Query & Resultset


abbruciato
01-31-02, 12:39
I have just installed mysql 4.0.1 alpha and myodbc 2.50.39-nt

My question is:
Why can't I do a Query like this:

BEGIN;
SELECT MAX(id) FROM Users;
COMMIT;

in a program using myodbc while I can do this query directly to mysql?

Doesn't support a query or a resulset of that kind?

Tank you.

webRat
02-06-02, 09:15
Works fine for me:

select max(test_id) from test_tbl;

select max(test_id) as lastTest_id from test_tbl;

Don't know why you have the BEGIN; & COMMIT; in there... I don't think you need them.

phpPete
02-22-02, 12:46
Check out this link re: transactions in MySQL:

http://www.mysql.com/doc/C/O/COMMIT.html