MySQL Forums
Forum List  »  General

Re: "Predicting" query results?
Posted by: Kevin Lin
Date: April 27, 2005 02:11PM

Tell me more about this "SELECT" command of which you speak...

Seriously, I suspected there was no way to do it easily-- most queries can be rewritten into select statements, but what I want is a way to do it automagically. I can't think of a simple search-and-replace PHP function that could take any arbitrary MySQL query and convert it into a SELECT that would return the rows that would have been affected.

Consider for example how a function could turn this into a SELECT:

UPDATE `users` SET lastlogin = NOW()

and still be able to handle this:

INSERT INTO `users` (username,email) VALUES ('steve','steve@yahoo.com'),('strongbad','sbad@homestarrunner.com'),('jdoe','jdoe@example.org') ON DUPLICATE KEY UPDATE username=user_id;

Options: ReplyQuote


Subject
Written By
Posted
April 27, 2005 11:57AM
Re: "Predicting" query results?
April 27, 2005 02:11PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.