November 8th, 2012, 05:14 PM
Join Date: Nov 2012
Time spent in forums: 2 h 23 m 2 sec
Reputation Power: 0
Using a value from another table in a where clause...
This is the code I have now...
CREATE DEFINER=`lifeprojectrpg`@`localhost` PROCEDURE `BankingTableDump`(IN rowid INT(12))
SELECT playeruid, money
WHERE id = rowid;
I want to add a date comparison to the where clause.
So basically the column is in the "information" table and it's called "lastlogin", it's in the format yyyymmdd (20121108). I want to subtract that from the current date and then if that equals greater than 15 or whatever integer then I want the whole query to return -1 and that's all, nothing else, but if it doesn't, if it equals less then run the above code normally and return the playeruid and the money. The lastlogin should be selected using the playerid which is selected from the "banking" table.
I've been trying to work this out for a couple of hours now and it's just beyond me so I would appreciate any help